# Frequently asked questions

# 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:

# 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 creates three text fields:

  • 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 for the full text.

This "long_document" field is not meant to be retrieved. It's defined only to search into the text. Please, 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 show it on the page.

If the record size exceeds the Algolia record limit, the XT Search indexer could split the document into several records. For more information, check the Algolia official documentation here: Indexing Long Documents (opens new window).

Remember to deduplicate the records if the content items have been split into several records. For instance, deduplicate the records by the id. Change the Distinc value to True (Configuration/ Search Behavior/ Deduplication and Grouping/ Distinc) and enable Attribute for Distinct and add the id to Configuration/ Search Behavior/ Deduplication and Grouping/ Attribute for Distinct. Finally, remember to confirm that long_document is included in the Searchable attributes.

Ref: Reducing Record Size (opens new window)

# 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:

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:

The template syntax is based on the mustache template engine (opens new window).

Last Updated: 6/10/2024, 2:49:04 PM