0

I have to implement below custom sort options

– Order: A to Z
– Order: Z to A
– Price: Low to High
– Price: High to Low

I have tried with the example given in link.
This is not working with elastic search. I am getting a message

We can't find products matching the selection.

Please help me if anyone has implemented this.

0

Custom Sort with ElasticSearch in Magento issue can be fixed by following these simple steps:

  • Navigate to Stores->Attributes->Product in Admin.
  • Add New Attribute.
  • In Properties->Attribute Properties:
    • Add Default Label (Eg: Price: Low to High)
    • Select the Catalog Input Type for Store Owner (Eg: Price) (In other cases Text Field is enough).
  • In Properties->Advanced Attribute Properties:
    • Add Attribute Code (Eg: price_asc).
  • In Storefront Properties->Storefront Properties:
    • Select User for Sorting in Product Listing to Yes

Once done with the above steps run the following commands,

bin/magento indexer:reindex catalogsearch_fulltext

bin/magento indexer:reindex
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.