eliasfernandez / phphinder
A PHP powered lightweight search engine
Requires
- doctrine/dbal: ^3
- predis/predis: ^2
- toflar/state-set-index: ^3.0
- wamania/php-stemmer: 3.0.1
Requires (Dev)
- phpunit/phpunit: ^11.4
- psy/psysh: ^0.12.4
This package is auto-updated.
Last update: 2025-05-14 18:07:56 UTC
README
A lightweight and modular search engine built in PHP.
Table of Contents
About
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.
Features
- 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
Installation
Install PHPhinder via Composer:
composer require eliasfernandez/phphinder
Usage
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());
Configuration
PHPhinder offers several configuration options, including custom analyzers, tokenizers, and more. Refer to the manual for detailed instructions.
Contributing
Contributions are welcome! Please review the contribution guidelines before submitting pull requests.
License
PHPhinder is open-source software licensed under the MIT license.