studiometa / foehn-search
Native search for Foehn — typo tolerance and relevance with Loupe, in SQLite, with no licence and no external service.
Requires
- php: ^8.5
- ext-intl: *
- ext-pdo_sqlite: *
- loupe/loupe: ^1.1
- studiometa/foehn: 0.13.0
- tempest/container: ^3.18
- tempest/discovery: ^3.18
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Native search for Føhn, with typo tolerance and relevance, from Loupe: SQLite files on the server, no licence and no external service.
See the documentation.
Note This package is part of the Føhn Framework monorepo. Please report issues and submit pull requests in the main repository.
Installation
composer require studiometa/foehn-search
studiometa/foehn-search requires the exact same version of studiometa/foehn. Upgrade the two packages together, for example composer require studiometa/foehn:<version> studiometa/foehn-search:<version>.
PHP needs the pdo_sqlite extension, with SQLite 3.35 or later, and the intl extension. The Føhn runtime image has both.
Why it is a package
Loupe brings doctrine/dbal and other dependencies that a site without search does not need.
What it provides
#[AsSearchDocument(postType: '…')]: a class that turns a post into a search document.- The index updates on save, trash, delete and term changes, through an
#[AsJob]job. - The search page answered by the index, with taxonomy filters, pages and
Facetsunchanged. SearchGroups: the results grouped by post type.GET /wp-json/foehn-search/v1/suggestions?q=: suggestions while a visitor types.wp foehn-search reindex: rebuild every index.- One index for each language, from the
Multilingualcontract.