We have stored documents into azure search. One of the document is having below field value.
"Title": "statistics_query.compute_shader_invocations.secondary_inherited fails"
We have defined custom analyzer on it as per the recommendation from MS Azure Team, in order to resolve one of the issue we were facing due to _ (underscore).
{
"name": "myindex",
"fields": [
{
"name": "id",
"type": "Edm.String",
"searchable": true,
"filterable": true,
"retrievable": true,
"sortable": false,
"facetable": false,
"key": true,
"indexAnalyzer": null,
"searchAnalyzer": null,
"analyzer": null
},
{
"name": "Title",
"type": "Edm.String",
"searchable": true,
"filterable": true,
"retrievable": true,
"sortable": true,
"facetable": true,
"key": false,
"indexAnalyzer": null,
"searchAnalyzer": null,
"analyzer": "remove_underscore"
}
],
"analyzers": [
{
"name": "remove_underscore",
"@odata.type": "#Microsoft.Azure.Search.CustomAnalyzer",
"charFilters": [
"remove_underscore"
],
"tokenizer": "standard_v2"
}
],
"charFilters": [
{
"name": "remove_underscore",
"@odata.type": "#Microsoft.Azure.Search.MappingCharFilter",
"mappings": [
"_=>-"
]
}
]
}
However, when I search with below Filters on my azure search index (version # 2016-09-01 Preview), i didnt get any result.
$filter=search.ismatch('"compute_shader_invocations*"','Title', 'full', 'any')
$filter=search.ismatch('"compute_shader_invocations"','Title', 'full', 'any')
$filter=search.ismatch('"shader_invocations*"','Title', 'full', 'any')
However, if I include the text with (.) dot character, the same filter works.
$filter=search.ismatch('"query.compute_shader*"','Title', 'full', 'any')
Based on my tests, if the document is having a dot (.) character present right after or before the search term used in the filters, then the search doesnt return result.
So, below filters wont work as there is a (.) dot character present in the document, right before and after the search terms used in the query. In our case there is a dot character present before word "compute" and after word "invocations" in the Azure Search Document.
$filter=search.ismatch('"compute_shader_invocations*"','Title', 'full', 'any')
$filter=search.ismatch('"compute_shader"','Title', 'full', 'any')
$filter=search.ismatch('"shader_invocations*"','Title', 'full', 'any')
However below filters should work, as there is no dot character present before the word "query" or after the word "shadder" in the Azure search document
$filter=search.ismatch('"query.compute_shader*"','Title', 'full', 'any') $filter=search.ismatch('"shader*"','Title', 'full', 'any')
This is driving me crazy. Any help would be highly appreciated.