# Frequently asked questions

# Do I have to buy the Algolia service?

Algolia has an offering to accommodate most project requirements. It has a Free tier and flexible paid subscriptions.

The benefits of the Free tier are:

  • 10 Units (10K Records/10K Operations)
  • Lightning fast search
  • Customizable relevancy engine
  • Must display "Search by Algolia"

For more information, https://www.algolia.com/pricing.

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 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 in the page.
    • If the text is long, it could be splitted in the in several records. For more information, about check this reference Indexing Long Documents.
    • If the text has been splitted in several records, remember to de-duplicate the record. For instance, deduplicate the records by the id. Enable Attribute for Distinct and add the id to Configuration/ Search Behavior/ Deduplication and Grouping/ Attribute for Distinct.

Ref: Reducing Record Size

# HOW-TO change the search results template

By default, the module has a hit-template, it can be customized to add new fields or change how the results are shown. This is a sample 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: