Phrase proximity with simple_query_string and NEST

I'm using the simple_query_string with the tilde ~ operator to specify proximity between words in a phrase, and it works. The simple query has other functions that match doesn't provide.

     {
               "simple_query_string":{

                  "query":"\"small demonstration\"~10",
                  "fields":[
                     "data"
                  ]
               }
    }

But, using "small demonstration"~10 or "\"small demonstration\"~10" in an equivalent NEST query doesn't add proximity search.

    m => m
		.SimpleQueryString(s => s
						.Query("small demonstration"~10)
						.Fields(f => f
						.Fields(emptyFieldArray))
						)

There can be multiple phrases using double-quotes, "phrase-1" other words "phrase-2". Can I add the tilde character to single or multiple phrases with NEST using the simple_query_string?

In the Fields method, at least one field needs to be specified.

.Fields(f => f
.Fields(specifyAtLeastOneFieldArray))

When the field array is empty, Elastic searches through all the fields, but it seems that it doesn't make use of the proximity character.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.