I need to get the documents from ES using NEST client with multiple like conditions on a single field.
My query is as:
SELECT * FROM Customer WHERE CustomerName LIKE '%john%' OR CustomerName Like '%george%'
My elastic search NEST query (for single like operation)is as:
var customers= ElasticSearchHelper.ElasticClient.SearchAsync<Customer>(body => body
.Take(100000)
.Filter(f => f
.And
(
fs=> fs.Query(q=> .QueryString(qs => qs
.Query("*" + SearchText + "*")
.OnField(new string[] { "FirstName"})
.DefaultOperator(Operator.or)
.MinimumShouldMatchPercentage(100)
.AnalyzeWildcard(true)))
)));
return customers.Documents;
How can I do this with multiple like operation on a single field? Please guide me what I am doing wrong.