Changing the default operator from OR to AND in Solr (Magento Enterprise)

前端 未结 6 1323
一向
一向 2021-02-01 23:28

I\'m using Solr with Magento Enterprise. I\'m trying to change the default search operator from OR to AND to make searches more specific by default.

6条回答
  •  终归单人心
    2021-02-02 00:11

    To answer my own question, I ended up overriding the Enterprise_Search_Model_Adapter_HttpStream model to inject ANDs into the search query. I added the prepareSearchConditions() method from Enterprise_Search_Model_Adapter_Solr_Abstract:

    It doesn't play nice with other operators obviously but in my case it's good enough™ (at least for now). I'm still hoping to find a better solution though.

提交回复
热议问题