Support » Plugin: Search by Algolia – Instant & Relevant results » Customize search query

  • Hi,

    I am looking for a way to customize the plugin in order to generate search results that starts with the query string. Like if I have a list of countries and regions of Asia in Algolia and query string is ‘In’ then the search should only fetch countries that starts with ‘In’ only like India, Indonesia and so on. It should not fetch those countries which contains ‘In’ in their names like Singapore, British Indian Ocean Territory.

    Please suggest a solution.

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor rayrutjes

    (@rayrutjes)

    Hello,

    By default, Algolia does just that as it does prefix searching.

    By default Algolia will only try to search by prefix of the last word in the query. There are many ways you can customize this behavior, and all of them are documented here: https://www.algolia.com/doc/guides/managing-results/optimize-search-results/override-search-engine-defaults/in-depth/prefix-searching/

    I hope that helps,

    Best,

    Thanks, but this option is not helpful.

    Algolia uses a query rule parameter ‘anchoring’ which has few possible values like is, startsWith, endsWith, contains and all. By default its value is all means search using all anchoring-types. I want to change this option to startsWith using WP plugin.

    Is it possible?

    Plugin Contributor rayrutjes

    (@rayrutjes)

    Hi again,

    I did not realize you were referring to the Query Rules feature.

    There is no specific feature related to Query Rules in this plugin.

    However you can customize the rules directly from within the Algolia dashboard.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Customize search query’ is closed to new replies.