I am trying to do a Match query using Nest using C#. The Match query does not return any results as the syntax of produced JSON seems off, I know for sure that there are documents that contains this keyword. Here is the C# code snippet
var response = conn.Search<DelOrder>(x => x
.From(0)
.Size(1000)
.Query(q => q
.Match
(m => m
.Field(f => f.customerName).Query(searchValue)
.Analyzer("standard")))
this produces following query:
{
"from": 0,
"size": 1000,
"query": {
"match": {
"customerName": {
"**query**": "star",
"analyzer": "standard"
}
}
}
}
This query, returns 0 results, however when I tweak the same query in Kibana console Get _search
{
"from":0,
"size":1000,
"query":
{
"match":
{
"customername":"star"
}
I get results for the searched term. Notice that the "second query token" is missing from the syntax of the Kibana query.
I did check the documentation and it seem my syntax is correct https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/match-usage.html
Any thoughts on what is going on or how to fix this issue.