I changed the default Fuzziness logic of ES from Fuzziness.AUTO to my own which is as follows -
0-3 - no edits allowed or Fuzziness.ZERO
4-10 - 1 edit allowed or Fuzziness.ONE
10+ - 2 edits allowed or Fuzziness.TWO
Earlier the way fuzzy was running was -
MultiMatchQueryBuilder queryBuilder2 = QueryBuilders.multiMatchQuery(QueryParser.escape(suggestion), FULL_SEARCH_FIELDS).fuzziness(Fuzziness.AUTO).lenient(true).boost(0.1f);
After this change I also added different boosts to each field required as follows -
QueryStringQueryBuilder queryBuilder2 = QueryBuilders.queryStringQuery(QueryParser.escape(suggestion)).analyzer("hsproduct").fuzziness(fuzziness).lenient(true);
for (ProductFuzzySearchKeywordEnum field : ProductFuzzySearchKeywordEnum.values()) {
queryBuilder2.field(field.getFieldName(), field.getFieldBoost());
}
After the above changes, the FUZZY isn't matching some basic things like "SCHOOL" with search "SCOOL" and "FOOTWEAR" with "FOOTWEAT".
I am currently on ES 5.1 and would appreciate if anyone can find something wrong with what I have done.