thelia / tnt-search-module
Installs: 703
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 7
Forks: 7
Open Issues: 2
Type:thelia-module
Requires
- ext-json: *
- teamtnt/tntsearch: 2.*
- thelia/installer: ~1.1
README
This module provides TNTSearch feature to Thelia. TNTSearch is a full-featured full text search (FTS) engine written entirely in PHP.
The module could be used in front-office, using the dedicated loop. It also replaces the standard back-office search.
Installation
Composer
Add it in your main thelia composer.json file
composer require thelia/tnt-search-module:~2.0
Configuration
The search indexes will be updated each time a product, category, folder, content, brand, ... is updated in the back-office. This could take some time, depending on your configuration. You can disable this reali-time udate in the module configuration, to speed up back-office changes.
In this case, you have to rebuild the indexes manually, using the Rebuild Indexes
button in
the module configuiration page, or automatically using a cron which trigger the index
build from time to time with this Thelia command: Thelia tntsearch:indexes
Thelia Loops
tnt-search loop
This loops return ids of the elements selected.
Input arguments
Output arguments
Example
To use this loop you need to combine it with another loop Index available : product,brand,category,folder,content,customer,order
{loop type="tnt-search" name="product-tnt-search-loop" search_for="product" locale="fr_FR" search=$search}
{loop type="product" name="product-loop" id=$PRODUCT order="given_id"}
Put your code here
{/loop}
{/loop}
The order="given_id"
is important because TNTSearch return the ids in order of pertinence.