Download the PHP package fromholdio/silverstripe-fulltext-filters without Composer
On this page you can find all versions of the php package fromholdio/silverstripe-fulltext-filters. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fromholdio/silverstripe-fulltext-filters
More information about fromholdio/silverstripe-fulltext-filters
Files in fromholdio/silverstripe-fulltext-filters
Package silverstripe-fulltext-filters
Short Description This module adds three fulltext SearchFilters to your SilverStripe project.
License BSD-3-Clause
Homepage https://github.com/fromholdio/silverstripe-fulltext-filters
Informations about the package silverstripe-fulltext-filters
silverstripe-fulltext-filters
This module adds three fulltext SearchFilter
s to your SilverStripe project.
FulltextBoolean
- similar to the existingFulltext
filter, but usesIN BOOLEAN MODE
, and transforms the search phrase to take full advantage of this. See characteristics of Boolean full-text searches here.FulltextRelevance
- adds relevance to the select query, accepts a 'Weight' argument which is applied to the relevance score, and provides hooks to sort results by the sum of all weighted indexes within the queryFulltextBooleanRelevance
- same asFulltextRelevance
but uses theFulltextBoolean
filter as its base and basis for matching. Uses the Boolean mode relevance calculation (which can differ from Fulltext in Natural Language Mode)
N.b. - Full-text relevance scores are binary (1 or 0) in Boolean Mode, unless the table engine is InnoDB. By default SilverStripe enforces MyISAM for tables containing a fulltext index. Use fromholdio-silverstripe-fulltext-innodb to overcome this.
Requirements
- silverstripe-framework ^4 & ^5
Recommended
- fromholdio/silverstripe-fulltext-innodb ^1.0 (for Silverstripe ^4)
Installation
composer require fromholdio/silverstripe-fulltext-filters
Details & Usage
In short, use this like any other set of SearchFilters
:
More documentation to come. Look at the source code in the meantime, or submit an issue.
Two key hooks:
- You can access the relevance value the database assigns per index and per record using
->{IndexName}Relevance
- Per the example above, these relevance values are made available within the query for
sort
but also available for additionalwhere
/etc, using variable names@{IndexName}Score
To Do
- Documentation 😅