HeadlinesBriefing favicon HeadlinesBriefing.com

Pure PHP Full-Text Search Engine Launches - No Dependencies

Hacker News •
×

A developer has released php-fts, a self-contained full-text search engine written entirely in PHP with zero extensions or external dependencies. The library uses trigram indexing with BM25+IDF scoring—the same relevance algorithm powering Elasticsearch and Lucene—making it tolerant to typos and partial matches while delivering ranked results.

The tool targets developers on shared hosting (OVH, Infomaniak, o2Switch) or those wanting a minimal stack. Benchmarks on a standard OVH shared plan with 10,000 documents show a median search time of 3.2ms. Bulk insertion runs approximately 2× faster than individual inserts, achieving 157.8 seconds for 50,000 documents on Linux.

Setup requires creating a SearchEngine instance with a directory path. The engine supports field boosting, combined AND/OR filtering, soft deletes with compaction, and atomic updates. Index files are portable across servers without rebuilding. Compatible with any PHP 8.1+ installation.