# Frequently asked questions
- Do I have to buy the Algolia service?
- How can I customize the module?
- Customize the Algolia Index and Search Queries
- Indexing Long Documents and Reducing Record Size
- HOW-TO change the search results template
- HOW-TO add a custom sort to a facet
- HOW-TO change a facet options to make it searchable
- HOW-TO add a custom transformation to a facet
- HOW-TO add a custom facet to the Instant Search
- HOW-TO add customize a facet of the Instant Search - II
# Do I have to buy the Algolia service?
Yes, Algolia has an offering to accommodate most project requirements. For more information, https://www.algolia.com/pricing (opens new window).
Our extensions, modules, and plugins for Joomla! and PrestaShop are paid to support our efforts to develop and integrate the Algolia service.
# How can I customize the module?
The module works indexing all the product information on Algolia Indexes, and then rendering the Algolia Widgets to render the search queries.
# Customize the Algolia Index and Search Queries
The customization follows a similar pattern. You must index first the information and customize the Algolia service to match your project requirements.
You can test the Algolia service and tune the information output from Algolia Dashboard.
Then, when the search service works as expected, you can override the module layout to adjust the visual output to match the visual design you are looking for.
Please, check our step by steps tutorials for Algolia:
- XT Search for Algolia - Installation for Joomla! (opens new window)
- XT Search for Algolia - FAQ for Joomla! (opens new window)
- XT Search for Algolia - Installation for PrestaShop (opens new window)
- XT Search for Algolia - FAQ for PrestaShop (opens new window)
# Indexing Long Documents and Reducing Record Size
Once you index the records and adjust how the queries are executed, it is essential to control how the records are managed. XT Search create three text fields to show the record:
short_description, a text field to show the search results with less than 32 characters.
description, a text field to show the search results with less than 256 characters.
long_document, the full text. This text is included to search into the full text.
- This field is not meant to be retrieved. Remove it from the Attributes to retrieve (Configuration/ Search Behavior/ Attributes to retrieve) or add it to the Unretrievable attributes (Configuration/ Search Behavior/ Unretrievable attributes) and shown on the page.
- If the text is long, it could be split into several records. For more information, about check this reference Indexing Long Documents (opens new window).
- If the text has been split into several records, remember to de-duplicate the record. For instance, deduplicate the records by the
id. Enable Attribute for Distinct and add the
idto Configuration/ Search Behavior/ Deduplication and Grouping/ Attribute for Distinct.
# HOW-TO change the search results template
By default, the module has a basic
hit-template. You can customize the hit template to change the layout or the displayed information:
The basic layout can be customized to add new fields or change how the results are shown. This is an alternative layout that includes an address in the hit template:
# HOW-TO add a custom sort to a facet
The widgets has
hooks than can be used to extend the original functionality. For instance, to change the sort order of a facet:
# HOW-TO change a facet options to make it searchable
By default, the facets in the widgets are defined with basic options. The initial configuration can be change before the search starts to work on the page. To make a facet searchable, add the following code to the page and configure the facet attribute as Searchable:
# HOW-TO add a custom transformation to a facet
The widgets has
hooks than can be used to extend the original functionality. For instance, to transform a facet:
# HOW-TO add a custom facet to the Instant Search
The widgets has
hooks than can be used to extend the original functionality. For instance, to add a new custom facet:
# HOW-TO add customize a facet of the Instant Search - II
The previous case shows how a new facet widget can be added in full. Now, this second example shows how the "category_name" facet widget can be redefined, tearing apart how the module generates the facets automatically by default.
# Remove the default position of the facet
By default, the facets are rendeted on the left side. To move it around, the facet placeholder must be removed from the array of facets.
Then, the placeholder
<div id="xtdir4alg_category_name" class="facet"></div> can be located in any location of the page.
# Change the facet widget to work as buttons
Redefine the facet template item to show the elements as buttons: