Algolia: remove relevance

Hi everyone.

I need to remove Relevance from sorting menu. I am using Magento2.

Trying to comment: vendor/algolia/algoliasearch-magento-2/view/frontend/web/instantsearch.js:120

algoliaConfig.sortingIndices.unshift({
  name: algoliaConfig.indexName + '_products',
  label: algoliaConfig.translations.relevance
})

but getting error:
Uncaught Error: [sortBySelector]: Index magento2_dev_test_std_store_view_products not present in `indices

Any ideas how to remove relevace properly?

Thanks for any help.

Hi there,

I’m Dorian, software engineer at Algolia.

In order to assist you as best as I can, I need a bit more context about what you are actually trying to do:

  • What do you mean exactly by removing relevance?
  • Why are you trying to remove it? What are you trying to accomplish?

More generally speaking, I would advise you not to comment or modify anything in a vendor folder because the next time you update it, you will have to re-apply all your changes/comments inside it. If I have more context on what you’re trying to achieve, I may be able to help you find how to properly do what you want the normal way in our extension.

Thanks in advance.
Happy coding!

Hi Dorian,

just want to remove this (‘Relevance’)
%D0%9C%D0%B5%D0%BD%D1%8E_010

I just want to stay other items, and set up default ‘Sort by date (asc)’
Looked option for adjusting in admin panel, but have didn’t get any success.

maybe this topic also is actual Possible to remove "Relevance" from sort options?

changed default index:

instantsearchOptions.indexName = 'my_new_default_sorting_index'

however, how to remove ‘Relevance’ option from sorting?