This article outlines how to troubleshoot issues with the search backend related to query rules.
Be sure to follow the How to Start Debugging Backend Search Issues help article for general troubleshooting steps first. Once you resolve your issue, you may skip the remaining steps.
General Troubleshooting Steps
At a high level, you will need to compare the query rule configuration against what the algorithm returned (shown in the search log).
- Open the query rule configuration:
- Navigate to Search > [[Experience Name]] > Query Rules.
- Review the criteria and actions configured.
- Open the search log for the query you’re seeing issues for. Either:
- Navigate to Search > [[Experience Name]] > Home or a Configuration sub-tab. Run a test search and then select Debug Query from the drop-down menu.
- If you’ve already run the search in a staging or production link, navigate to Search > [[Experience Name]] > Search Logs and click on the relevant search log. Use the search bar or filters to help you find the correct search log or run the search again to have it appear at the top.
- Check whether the query rule was applied by seeing whether it’s shown in the search factors box of the search log.
- If the query rule isn’t shown in the search log, double check the query rule criteria in the configuration and confirm whether the search you ran meets that criteria.
- If the criteria uses regex, check the regex pattern specified against a debugging tool.
- If the criteria uses context or referrer page URL, check whether it was picked up for the search. These would be listed under the Query Parameters attribute in the Search Factors box if so.
- If the criteria uses vertical keys or search types, check the Searcher Type is correct in the search metadata. Also, double check that the vertical key has not changed.
- If the query rule appears (the criteria is met), but the vertical or entity you expect to appear is not in the result set (or you are getting no results), double check the expected results intersect with the query rule action.
- If you reference a field API name, entity type API name, vertical key, or an entity ID, make sure that it matches exactly and hasn’t changed.
- Check that the actions are configured properly to match what you want to happen. For example, if you’re boosting entities, are the entities listed in the order you want them returned?
Query Rules are not working with synonyms
Query rules are meant to take precedence over everything in Search, since they are pieces of hardcoded logic meant to conditionally override the existing configuration. Therefore, these won’t work with synonyms.
For instance, if your rule criteria is searchTermExactlyMatches
”shoes” and you’ve created one way synonym where “sneakers” —> “shoes”, the rule will not fire if “sneakers” is searched. To get around this, you should use a broader rule criteria, i.e. searchTermContains
”shoes” or “sneakers”, or create a rule for each synonym.
Comments
0 comments
Please sign in to leave a comment.