I have a field called machineTag in Azure Search Index created with below details:
"analyzers": [
{
"@odata.type": "#Microsoft.Azure.Search.CustomAnalyzer",
"name": "SWMLuceneAlongWithCustomHyphenAnalyser",
"tokenizer": "keyword_v2",
"tokenFilters": [
"lowercase"
],
"charFilters": []
}
]
and the index is
{
"name": "machineTag",
"type": "Edm.String",
"searchable": true,
"filterable": true,
"retrievable": true,
"sortable": true,
"facetable": true,
"key": false,
"indexAnalyzer": null,
"searchAnalyzer": null,
"analyzer": "SWMLuceneAlongWithCustomHyphenAnalyser"
}
Now, there is text in this field called "high Machine", but my query:
search=machineTag:/.*high\%20machine.*/&$count=true&$top=100&$skip=0&$filter=machineTag%20ne%20null&$queyType=full
doesn't return any results. Am I doing anything wrong here?
If I test the analyzer, it returned a result as shown below, and my understanding is that escaping space should return results: Input Body:
{
"analyzer":"SWMLuceneAlongWithCustomHyphenAnalyser",
"text": "high Machine"
}
Response:
{
"@odata.context": "https://abcd/$metadata#Microsoft.Azure.Search.V2016_09_01.AnalyzeResult",
"tokens": [
{
"token": "high machine",
"startOffset": 0,
"endOffset": 12,
"position": 0
}
]
}
Asking the question in another way, the field would contain text with space and * character. If the analyzer is wrong, please suggest..