How to change the results order alphabetically

How to show the search results alphabetically in algolia results page ?

Hi @jayashreen,

You can find more information about sorting your results in our documentation here.

It will depend on the Algolia api client or extension you are using. I believe you are using Magento 2. You can find more about sorting in Magento2 here.

Hi Cindy,

Alphabetical sorting(product name) works fine while searching from the search box. Whereas while applying filters, the result couldn’t get sorted alphabetically. While analyzing we found that the filter result will only consider the filter values, not a product name. I just want to sort the results (based on the product name) alphabetically even the filter is applied?

Can I achieve this?

Hi Cindy,

The results , I mean the products names should be sorter alphabetically even the filters applied?

Hi @jayashreen, I’m not sure I understand. The filters shouldn’t affect the sort order of your results, assuming you have things set up correctly.

Could you provide a codesandbox to demonstrate your issue? We have starter templates here.

If you are trying to accomplish this in Magento, can you give us a link to where this is happening with steps to duplicate the issue. Also, let us know if you have customized the Magento search.

I have already share my issue details through email to the support team, But still no response. Can you please share your email then I will send detailed screenshot regarding my issues

Okay can you tell me , how to sort the results alphabetically in Algolia?

Hi @jayashreen,

I have responded to your support ticket.

However, while sorting alphabetically makes sense for a database, it doesn’t for a search engine and we strongly discourage it . This isn’t to say your use case is invalid; rather, we want to encourage caution and due consideration.

When you sort your data alphabetically, you don’t only devalue Algolia’s tie-breaking algorithm: you essentially disable it . If you sort alphabetically first, then the only objects requiring tie-breaking are those with the exact same name: there will likely be few objects that fit this criterea.

Alphabetically structured results lead users to search through data by hand, while a search engine, like Algolia, should ensure that they don’t need to.

Warnings aside, it is still possible to sort alphabetically. However, because the attributes you use for sorting must be numeric or boolean values, sorting alphabetically is a non-trivial problem and can only be implemented through the API.

You find instructions for sorting alphabetically using the API here.