Reputation: 1322
I am new to Azure Search
. I am trying to use "contains"
logic in my search query. I looked it up and found out that I need to add something like following in my search query.
&queryType=full&search=/.*_search.*/
where _search in the string I want to search. Now what happens is that the "contains" logic works fine. For example, I try to search sweep and I get well sweep-cmu in the results.
But, when I search well sweep-cmu, I get zero results. Why? and how can I improve my query to get results when I enter partial and full strings.
Upvotes: 1
Views: 1509
Reputation: 133
If you want exact match for the search query please surround the query with double quotes. eg: "well sweep-cmu" This will return all documents which contain the exact phrase.
Since you've just started to play with Azure Search you might find this article particularly interesting. It explains how the full text search works in Azure Search. https://learn.microsoft.com/en-us/azure/search/search-lucene-query-architecture
In order to get results for partial terms, you should use wildcard expressions in your search queries. The above article explains this in detail. PS: Some wildcard queries can be very expensive and hence slow.
Upvotes: 3