I am having issues while searching for terms with special charachters in it with queryType set to full. Take this example: https://learn.microsoft.com/en-us/azure/search/query-lucene-syntax#escaping-special-characters
If I use:
{
"search": "https\:\/\/*",
"queryType": "full",
"highlight": "content"
}
I get the error FieldNotSearchable: Illegal arguments in query request: https is not a searchable field.
This means that it's using https: as a field selector.
Can someone explain too me why it's not excaping the :?
If I use
{
"search": "https\:\/\/*",
"queryType": "simple",
"highlight": "content"
}
I got empty results, which is what I'm expecting
In the
fullqueryType, the\used does not escape the:character and is considered a Fielded search. It interprets it ashttps://and gives an error, stating it is not searchable since you don't havehttpsfield. Refer to the documentation below for more information on Fielded search:Lucene query syntax - Azure AI Search | Microsoft Learn
In the
simplequeryType, the Fielded search is not considered, and it searches for the entire string.You can see the difference in results when searching for the field named
street:simplefullIn
simple, it returns results for the word "street," but infull, it searches for the word "red" in the fieldstreet.Therefore, in the
fullqueryType, you need to use\\to escape the characters.This should return results for the word "street" since the
:is escaped.Searching for
https\\:\\/\\/*will yield empty results.