Closed atarora closed 1 year ago
Thanks for submitting this. I tried to replicate that and I'm able to make the replace rules work. Can you try a page refresh and see if you can still see the reported behavior?
If the behavior still is the same: Can you attach the contents of your .querqy
collection and the output of the query that's being built?
You should be able to get the latter in the dev console in Kibana by running something like the following command:
POST ecommerce/_validate/query?explain=true { "query": { "querqy": { "matching_query": { "query": "latpop" }, "query_fields": [ "id", "name", "title", "product_type", "short_description", "ean", "search_attributes" ], "rewriters": ["common_rules", "replace"] } } }
That'll help to identify what the underlying issue is. Thanks!
{ "_shards" : { "total" : 1, "successful" : 1, "failed" : 0 }, "valid" : true, "explanations" : [ { "index" : "ecommerce", "valid" : true, "explanation" : "+(short_description:laptop | product_type:laptop | ean:laptop | name:laptop | id:laptop | search_attributes:laptop | title:laptop)" } ] }
Could it be that the replace rewriter is configured and fine but just not applied when we send the search request from the app? (= the rewriter name is missing in the search request?)
I think I found the issue. The configuration looks alright but it's the order of the rewriters that are applied. I can verify and test that next week.
Alternatively, if you want to give it a try @atarora, you can find the configuration of the requests in this file:
chorus-elasticsearch-edition/reactivesearch/src/App.js
By changing the order of the configured rewriters the replace rule should be executed before the common rules and everything should work as supposed.
It was the order of the rewriters that prevented them from working correctly. I created a PR to fix this: https://github.com/querqy/chorus-elasticsearch-edition/pull/17
This was fixed in #17
The rules configured are not applied for suggested spellings.
(From the attached screenshots note the difference in search results)