I am planning on creating a site search.
Which search do you recommend? It gets a bit confusing with so many options.
I'd like to take the values from an HTML form input field and perform some fuzzy matching, across all fields in my index.
Those fields will probably be:
- Page Title
This is what I'm currently using for a separate search, for firstname and lastname.
MatchQueryBuilder matchFirstname = new MatchQueryBuilder("firstname", firstname).fuzziness(Fuzziness.AUTO); MatchQueryBuilder matchLastname = new MatchQueryBuilder("lastname", lastname).fuzziness(Fuzziness.AUTO); BoolQueryBuilder qb = boolQuery().must(matchFirstname).must(matchLastname); SearchSourceBuilder sourceBuilder = new SearchSourceBuilder(); sourceBuilder.query(qb); SearchRequest searchRequest = new SearchRequest(indexName); searchRequest.source(sourceBuilder);
This current search does not provide any fuzziness. When I search for "Tim"(firstname) and "Brow" (lastname) I am not getting "Timothy Brownlee" returned as one of the records, when I should.
Any ideas on how to approach this and why my Fuzziness is not working as I hope?