TNTSearch logo

TNTSearch

PHP-native full-text search engine with real-time indexing

A pure-PHP full-text search engine offering fuzzy, boolean, and geo-search, dynamic indexing, multilingual stemming, and easy Composer installation for Laravel and custom PHP projects.

TNTSearch banner

Overview

Overview

TNTSearch is a full‑text search engine written entirely in PHP, aimed at developers who need an on‑site search solution without external services. It works out of the box with Laravel Scout and any PHP application that can run Composer.

Capabilities

The engine supports fuzzy matching, boolean queries, geo‑search, and result highlighting. Built‑in stemmers cover several languages and custom tokenizers let you tailor word splitting. Indexes are stored in SQLite files and can be updated dynamically—insert, update, or delete documents without a full reindex. Ranking uses the BM25 algorithm, and helper functions such as Jaro‑Winkler and cosine similarity are included.

Deployment

Installation is a single Composer command (composer require teamtnt/tntsearch). The package requires PHP ≥ 7.4 with PDO, SQLite, and mbstring extensions. Configuration is done via a simple PHP array, and indexes are written to a writable directory you specify. This makes TNTSearch quick to set up and easy to maintain in typical PHP hosting environments.

Highlights

Fuzzy and boolean search with configurable Levenshtein distance
Dynamic index updates without full reindex
Built-in multilingual stemming and custom tokenizer support
BM25 ranking and result highlighting out of the box

Pros

  • Pure PHP implementation removes external service dependency
  • Fast query performance with BM25 ranking
  • Simple Composer installation and configuration
  • Supports real-time index modifications

Considerations

  • Relies on SQLite for index storage, may not scale to massive datasets
  • Advanced features like geo-search require custom setup
  • Limited to PHP 7.4+ environment
  • No built-in distributed clustering

Managed products teams compare with

When teams consider TNTSearch, these hosted platforms usually appear on the same shortlist.

Algolia logo

Algolia

Hosted search-as-a-service platform delivering real-time, full-text search for apps and websites

Amazon CloudSearch logo

Amazon CloudSearch

Managed search service to index and query text & structured data

Amazon Kendra logo

Amazon Kendra

AI-powered enterprise search service that indexes and searches across various content repositories with natural language queries

Looking for a hosted option? These are the services engineering teams benchmark against before choosing open source.

Fit guide

Great for

  • Small to medium PHP applications needing on-site search
  • Laravel projects using Scout for seamless integration
  • Projects that require customizable tokenization or language stemming
  • Teams that prefer a self-hosted search solution over SaaS

Not ideal when

  • Enterprise-scale search across billions of documents
  • Environments where Java or Elasticsearch are already standardized
  • Applications requiring out-of-the-box distributed indexing
  • Systems lacking PHP 7.4 or required extensions

How teams use it

Search TV show catalog

Instant, typo-tolerant lookup of titles and descriptions for a streaming interface.

Documentation search for PHPUnit

Fast retrieval of relevant API pages directly from the docs site.

City lookup with n-gram support

Responsive auto-complete for geographic names, handling partial inputs.

User directory search in Laravel

Real-time filtering of users by name or email with fuzzy matching.

Tech snapshot

PHP100%

Tags

search-enginetntsearchlaravel-scouthacktoberfestfuzzysearchfulltextphpfuzzy-searchfuzzy-matchingfull-text-searchgeo-search

Frequently asked questions

What PHP version is required?

PHP 7.4 or newer, along with PDO, SQLite, and mbstring extensions.

Can the index be updated without rebuilding?

Yes, TNTSearch provides insert, update, and delete methods that modify the index on the fly.

Is there support for languages beyond English?

Built-in stemmers cover English, Croatian, Arabic, Italian, Russian, Portuguese, and Ukrainian, and custom Snowball stemmers can be added.

How do I integrate TNTSearch with Laravel?

Use the Laravel Scout driver provided by the package; configure the driver in `config/scout.php` and run the usual Scout commands.

Does TNTSearch require an external service?

No, it runs entirely within PHP and stores its index in SQLite files, eliminating the need for separate search servers.

Project at a glance

Active
Stars
3,202
Watchers
3,202
Forks
297
LicenseMIT
Repo age9 years old
Last commitlast month
Self-hostingSupported
Primary languagePHP

Last synced 3 hours ago