Completion of particular terms with proximity matching [5.6]

Hi,

I would like to be able to query for quick b* f* in an index containing : quick brown fox, q brown fox, q brown asd eoigj dfg fox. This query must just return quick brown fox. Additionally, a search for q brown fox should only match q brown fox

I have tried using an edge n-gram analyzer at index time, with a query such as:

{
 "query_string": {
    "quote_field_suffix": ".exact",
    "query": "\"q\" b",
    "default_operator": "AND"
  }
}

In the example I've given above, I've also provided the documents with an exact field at index time, as in the example given on this page, which enables us to exclude quick brown fox from the query results. I also specified the search_analyzer to be standard upon creating the index.

Unfortunately, this solution will still include q brown asd eoigj dfg fox. Does anybody know how I could also enforce that \"q\" and b* should be adjacent when I'm using quote_field_suffix in a query_string query?

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