0
votes

I'm doing a simple query_string query that looks like this:

"query_string" : {
    "default_operator" : "AND",
    "fields" : ["title^20","keywords^10","description^8","content^1","titles^6","highlights^4"],
    "query"  : "\"south west\""
}

However, the search is matching documents with the words "south" and "west" that are not necessarily adjecent, e.g. "We are seeing low flying buzzards in the south of england and also the west". I would like it to only return results that match the exact phrase, e.g. "We are seeing low flying buzzards in the south west of buckinghamshire".

The analyzer used for both search and indexing is the snowball analyzer and I am guessing that this may be the root of the issue, i.e. do phrase queries not work with the snowball analyzer?

Any ideas?

TIA

Dominic

1
I am having hard time reproducing the issue - gist.github.com/imotov/f6e47b06f4444d5003f0. Could you add a repro to your question?imotov
Thanks for that, hopefully your gist will help me narrow down the issue. Will update with either repro or solution.dom_watson
The issue was to do with the way my DSL was being serialized (quotes and escape characters were being double escaped). Apologies for the time wastage - I'll be sure to use plain CURL test cases in the future.dom_watson

1 Answers

0
votes

User error. The DSL was being incorrectly serialized.