A lightweight and modular search engine built in PHP.
PHPhinder is an open-source, lightweight, and modular search engine designed for PHP applications. It provides powerful search capabilities with a focus on simplicity, speed, and extensibility.
- Full-text search for indexed documents.
- Support for advanced queries, including prefix queries, AND/OR/NOT combinations, and field-specific searches.
- Lightweight and efficient, with minimal dependencies.
- Easy integration with Symfony or other PHP frameworks.
- Highly extensible, allowing customization of query parsers and indexers.
- Fuzzy search. If no exact matches are found typo tolerance search is triggered
Install PHPhinder via Composer:
composer require eliasfernandez/phphinder
Here’s a simple example to demonstrate PHPhinder in action:
use PHPhinder\Index\JsonStorage;
use PHPhinder\SearchEngine;
$storage = new JsonStorage('var');
$engine = new SearchEngine($storage);
$engine->addDocument(['_id' => 1, 'title' => 'Hi', 'text' => 'Hello world!']);
$engine->flush();
$results = $engine->search('Hello');
print_r($results[1]->getDocument());
PHPhinder offers several configuration options, including custom analyzers, tokenizers, and more. Refer to the manual for detailed instructions.
Contributions are welcome! Please review the contribution guidelines before submitting pull requests.
PHPhinder is open-source software licensed under the MIT license.