I am trying to query a azure search index which has special chars. I am not getting the intended results with the following query,
{
"search": "*",
"filter": "search.ismatch('*\\ca-\\*', 'Text')",
"count": true,
"top": 10
}
Results set,
[{
"Id": "11110",
"Author": null,
"Text": "ca-1000"
},
{
"Id": "11123",
"Author": null,
"Text": "da-20000"
},{
"Id": "11136",
"Author": null,
"Text": "ca 900"
}]
Expected,
[{
"Id": "11109",
"Author": null,
"Text": "ca-1000"
}]
Basically, I want to query the "Text" field of any record that has value "ca-". What am I missing here?
UPDATE
Its also returning with records with just "ca",
Based on the provided information, the issue might be because of using same
id value
for both document and the later value is being update to same id.To solve this try giving different id for each entry.
You can check the below code snippet:
With above setup I was able to get required results: