Search code examples
azureazure-cognitive-search

how azure search treat string like "Good Phase" To search on cloud db


I need technical help regarding my Azure document search

below my sample code

`var searchText = "Good Phase"

var searchData = indexClient.Documents.Search(searchText,searchParameters)`

I need to know this document search which is searchText = "Good Phase"

how azure document treat this "Good Phase" to search

means like

1:- Good AND Phase (with AND operator)

2:- Good OR Phase (With OR Operator)


Solution

  • When searching text such as “Good phase”, the search text is tokenized so that your terms will be separated by white space to two terms: “Good” and “phase” and the search results will be either term. If you want all the terms to match you can specify searchmode=all, the default value is any.

    More details you can find here: https://learn.microsoft.com/en-us/rest/api/searchservice/search-documents And also another good source: https://learn.microsoft.com/en-us/azure/search/search-lucene-query-architecture which explains how full text search works in Azure Search.

    Thanks!