PHPackages                             yetidevworks/yetisearch - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. yetidevworks/yetisearch

ActiveLibrary[Search &amp; Filtering](/categories/search)

yetidevworks/yetisearch
=======================

A powerful, pure-PHP search engine library with advanced features

2.3.1(2mo ago)70264[2 PRs](https://github.com/yetidevworks/yetisearch/pulls)MITPHPPHP ^7.4|^8.0|^8.1|^8.2|^8.3|^8.4CI passing

Since Jul 11Pushed 1mo agoCompare

[ Source](https://github.com/yetidevworks/yetisearch)[ Packagist](https://packagist.org/packages/yetidevworks/yetisearch)[ RSS](/packages/yetidevworks-yetisearch/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (15)Versions (17)Used By (0)

YetiSearch
==========

[](#yetisearch)

[![CI](https://github.com/yetidevworks/yetisearch/workflows/CI/badge.svg)](https://github.com/yetidevworks/yetisearch/actions)[![PHP Version](https://camo.githubusercontent.com/9a0866d6af09cc7413f8550e04b6ec6748ce8129d8504de18ef3861a0c27b50d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f79657469646576776f726b732f79657469736561726368)](https://packagist.org/packages/yetidevworks/yetisearch)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](LICENSE)[![Latest Stable Version](https://camo.githubusercontent.com/de45263dee9b44a2b6a64b489af7f973557aab0cd01a5977c9e4b8777ebb33f5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f79657469646576776f726b732f79657469736561726368)](https://packagist.org/packages/yetidevworks/yetisearch)

A powerful, pure-PHP search engine library with advanced full-text search capabilities, designed for modern PHP applications.

> Important: Requires SQLite FTS5 (full‑text search) support in your PHP’s SQLite library. See “Requirements” for a quick check.

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Example Applications](#example-applications)
- [Usage Examples](#usage-examples)
    - [Basic Indexing](#basic-indexing)
    - [Advanced Indexing](#advanced-indexing)
    - [Search Examples](#search-examples)
    - [Document Management](#document-management)
- [Configuration](#configuration)
- [Advanced Features](#advanced-features)
    - [Document Chunking](#document-chunking)
    - [Field Boosting and Exact Match Scoring](#field-boosting-and-exact-match-scoring)
    - [Multi-language Support](#multi-language-support)
    - [Custom Stop Words](#custom-stop-words)
    - [Geo-Spatial Search](#geo-spatial-search)
    - [Search Result Deduplication](#search-result-deduplication)
    - [Highlighting](#highlighting)
    - [Fuzzy Search](#fuzzy-search)
    - [Faceted Search](#faceted-search)
- [Architecture](#architecture)
- [Testing](#testing)
- [API Reference](#api-reference)
- [Performance](#performance)
    - [Benchmark Results](#benchmark-results)
    - [Performance Characteristics](#performance-characteristics)
    - [Performance Tuning](#performance-tuning)
    - [Bottlenecks and Solutions](#bottlenecks-and-solutions)
    - [Comparison with Other Solutions](#comparison-with-other-solutions)
    - [Best Practices for Performance](#best-practices-for-performance)
- [Future Features](#future-features)
- [Contributing](#contributing)
- [License](#license)
- [Type-Ahead Setup](#type-ahead-setup)
- [Weighted FTS and Prefix (Optional)](#weighted-fts-and-prefix-optional)
- [Suggestions](#suggestions)
- [Synonyms](#synonyms)
- [DSL (Domain Specific Language)](#dsl-domain-specific-language)
- [CLI](#cli)

Features
--------

[](#features)

- 🔍 **Full-text search** powered by SQLite FTS5 with BM25 relevance scoring
- 📄 **Automatic document chunking** for indexing large documents
- 🎯 **Smart result deduplication** - shows best match per document by default
- 🌍 **Multi-language support** with built-in stemming for multiple languages
- ⚡ **Lightning-fast** indexing and searching with SQLite backend
- 🔧 **Flexible architecture** with interfaces for easy extension
- 📊 **Advanced scoring** with intelligent field boosting and exact match prioritization
- 🎨 **Search highlighting** with customizable tags
- 🔤 **Advanced fuzzy matching** with automatic typo correction and multi-algorithm consensus scoring (Trigram, Jaro-Winkler, Levenshtein, Phonetic, Keyboard Proximity)
- 🎯 **Enhanced multi-word matching** for more accurate search results
- 🏆 **Smart result ranking** prioritizing exact matches over fuzzy matches
- 📈 **Faceted search** and aggregations support
- 📍 **Geo-spatial search** with R-tree indexing for location-based queries
- 🚀 **Zero dependencies** except PHP extensions and small utility packages
- 💾 **Persistent storage** with automatic database management
- 🔐 **Production-ready** with comprehensive test coverage
- ✨ **NEW: Multi-column FTS** with native BM25 field weighting (enabled by default)
- ✨ **NEW: Two-pass search** for enhanced primary field prioritization (optional)
- ✨ **NEW: Improved fuzzy consistency** - exact matches always rank higher
- ✨ **NEW: DSL Support** - Natural language query syntax and JSON API-compliant URL parameters
- ✨ **NEW: Query Result Caching** - 10-100x faster repeated searches with automatic invalidation
- ✨ **NEW: Enhanced Fuzzy Search** - Modern typo correction with multi-algorithm consensus scoring (phonetic, keyboard proximity, trigram, Levenshtein, Jaro-Winkler)

Requirements
------------

[](#requirements)

Important: SQLite FTS5 required

- YetiSearch uses SQLite FTS5 virtual tables for full‑text search and BM25 ranking. Your PHP build must link against a SQLite library compiled with FTS5 (ENABLE\_FTS5).
- **SQLite 3.24.0 or higher** is required (for `ON CONFLICT` upsert support). SQLite 3.35.0+ is recommended for best performance (uses `RETURNING` clause to avoid extra queries).
- Quick check: `php scripts/check_sqlite_features.php` should report "FTS5: OK" and show the SQLite version. On macOS, Homebrew PHP typically includes a recent SQLite with FTS5; some system PHP builds may not.
- PHP 7.4 or higher
- SQLite 3.24.0 or higher (3.35.0+ recommended)
- SQLite3 PHP extension
- PDO PHP extension with SQLite driver
- Mbstring PHP extension
- JSON PHP extension

Installation
------------

[](#installation)

Install YetiSearch via Composer:

```
composer require yetidevworks/yetisearch
```

Quick Start
-----------

[](#quick-start)

```
