i using azure search , want use clause of sql
query using in azure
https://serivename.search.windows.net/indexes/catalogsearch/docs? api-version=2015-02-28&search =mc*&querytype=simple&searchmode=all
but not working
what have tried:
how can use azure search syntax
https://azure.microsoft.com/en-us/blog/lucene-query-language-in-azure-search
there answers in comments using wildcard * like% style queries, might want %like queries well. this, need create custom analyzer.
the reason why need because way default indexing works indexes starts of word. example, word microsoft, indexing done on m, mi, mic, etc...
this makes easy search mic%, not work %soft. work , need use bit of trick tell analyzer reverse words , index index (you can see example of analyzer "suffixanalyzer" below). example microsoft, indexing of t, tf, tfo, tfos, etc... not work since want able search %soft, indexing reversed words (i.e. tofs rather soft). have analyzer reveres (you can see example of analyzer "reveresetext" below).
now need new field uses "suffixanalyzer" indexing , "reveresetext" searchanalyzer (you can see example of field "suffixname" below).
"fields": [ { "name":"suffixname", "type":"edm.string", "searchable":true, "searchanalyzer":"reversetext", "indexanalyzer":"suffixanalyzer" } ] "analyzers": [ {"name":"suffixanalyzer","@odata.type":"#microsoft.azure.search.customanalyzer","tokenizer":"standard","tokenfilters":[ "lowercase", "asciifolding", "reverse", "my_edgengram" ]}, {"name":"reversetext","@odata.type":"#microsoft.azure.search.customanalyzer","tokenizer":"standard","tokenfilters":[ "lowercase", "reverse" ]} ]
once have this, can search on suffixname field "soft" , find @ fast query rate.
by way, can create prefix analyzer following analyzer make don't have use wildcard.
"analyzers": [ {"name":"prefixanalyzer","@odata.type":"#microsoft.azure.search.customanalyzer","tokenizer":"standard","tokenfilters":[ "lowercase", "my_edgengram" ]} ] "fields": [ { "name":"partialname", "type":"edm.string", "searchable":true, "searchanalyzer":"standard", "indexanalyzer":"prefixanalyzer" }, ]