Query_string - fuzzy - stemmer


(Ben G) #1

I have the english stemmer on an analyzer which is used on a field. when I search exact it works fine. when I add ~ it doesnt match anything. ie:

This works

{
  "size": 20,
  "query": {
    "query_string": {
      "query": "googles",
      "default_field": "search",
      "default_operator": "and",
      "fuzziness": 1,
      "fuzzy_prefix_length": 1
    }
  }
}

this does not work

{
  "size": 20,
  "query": {
    "query_string": {
      "query": "googles~",
      "default_field": "search",
      "default_operator": "and",
      "fuzziness": 1,
      "fuzzy_prefix_length": 1
    }
  }
}

I've tested the analyzer and I can see its dropping the 'es' from the end to 'googl' on index from stemming.

I'm guessing on search the stemming is not being applied to the term as 'googles~' is further than 1 fuzziness from the indexed 'googl'. 'google~' matches.

I've read here that stemming is excluded on wildcards but it doesnt say anything on fuzziness.

Is this expected behavior? if so what would be the alternative? the reason I use query_string is so I can control which words can be fuzzy matched. I've tested the 'match' query with fuzziness and that works as expected.

Thanks
Ben


(system) #2

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