Hello All,
I want to write an elasticsearch query in C# which can search multiple words in multiple fields.
For example.
Query: John California Honda
Fields: Name, State, Car
This query should search the term John in all three fields and so on for the other terms present in the query.
Note: the sequence can differ and the number of terms in the query can be more or less.
var searchResult= client.Search<cars>(s => s
.AllTypes()
.Size(50)
.Query(q => q.Bool(b => b
.Must(mu => mu
.MultiMatch(m => m
.Fields(f => f.Field("Name").Field("State").Field("Car"))
.Query("John")
) && q
.MultiMatch(m => m
.Fields(f => f.Field("Name").Field("State").Field("Car"))
.Query("Califronia")
)
Above is my code, How can I modify this query that it should match according to the number of terms in the query string. (Dynamic)