zendframework/zendsearch
ZendSearch provides full-text search capabilities for PHP apps, offering indexing, querying, and analysis tools inspired by Lucene. Useful for adding fast, flexible search to your project with customizable analyzers, tokenizers, and query parsers.
Zend_Search_Lucene instantiation in a provider).filesystem facade to store/load indexes.SearchRepository::query($term)).foreach changes, type system) may break functionality.LIKE queries)?return_type polyfills for PHP 7+).nikic/php-parser for syntax fixes).zendframework/zend-escaper carefully (duplicates Symfony’s StringUtils).LIKE or Algolia).// app/Providers/SearchServiceProvider.php
public function register() {
$this->app->singleton('lucene', function() {
$index = new \ZendSearch\Lucene\Index('storage/lucene_index');
return $index;
});
}
LIKE queries with Lucene for critical paths.saved/deleted.SearchIndexJob).Illuminate\Support\Facades\Cache.@php 7.4 directive or runtime polyfills.Illuminate\Support\Str for string escaping.class FallbackSearch {
public function search($term) {
try {
return $this->lucene->search($term);
} catch (\Exception $e) {
return Model::where('name', 'LIKE', "%$term%")->get();
}
}
}
Searchable trait for Eloquent models.php artisan search:rebuild).lucene_index_v2).ZendSearch\Lucene\Analysis\Analyzer logs or Xdebug to trace queries.rm -rf of the storage directory.memory_get_usage() in a cron job.How can I help you explore Laravel packages today?