Need to change index sortering when user start typing in the search box

Default sort index is ‘magento2_dev_test_store_view_products_name_asc’.

But when customer start typing i need to change sort index to ‘magento2_dev_test_store_view_products_created_date_desc’ automatically.

And after i can change sort order of search result use select sort dropdown.

Hi @projdevel,

I want to make sure I understand what you are trying to do. Do you want the autocomplete dropdown to use the ‘magento2_dev_test_store_view_products_created_date_desc’ index?

I look forward to your reply!

Hi @cindy.cullen, just I need ONLY for SEARCH (when i enetering some word in search field) i have to sort by SOME_INDEX_ASC, but if change sort(select dropodown) after search, it will sort by selected index(ANOTHER_SELECTED_INDEX).

Hi @projdevel,

In our Magento extensions you can have multiple sort orders that the user can choose.

For Magento 1:

For Magento 2:

Is this what you are looking for?