The fields for the following queries need to be set up with "keyword" analyzer within the index for the query to be sargable for the index:
This change is necessary to assure consistent results during a covering and a non-covering query scenario when no index options are specified within the SEARCH(..) function.
This will also change the behavior for the above mentioned queries, but in a good away - that the user will always see the same result with and without validation.
Note: this issue in validation (with a non-covered query) could still happen over certain data with over Match and MatchPhrase queries when the user has an index with a field using non-standard analyzer and does NOT specify the index name within options or the analyzer within the query.
Here's an example:
- Search phase would return the document as the match query (which uses the keyword analyzer) wouldn't match Sales with Pre-sales.
- However, during the validation phase - since there's no index context, or analyzer explicitly specified for the match query - the default analyzer is used which causes the document to not be returned for the query.
The workarounds here are these queries ..