Combine Phrases search AND fuzzy matching

(paris) #1

Hi,

I wonder if there is a way to combine fuzzy match and Phrase search within text.

EG of searching pattern:
"combime phrases and fuzsy matsh"
Would match
"combine phrases and fuzzy match"

Thanks for your answer !

Searching Google Books
(Doug Turnbull) #2

It appears, not directly with match_phrase directly:

Fuzziness works only with the basic match and multi_match queries. It doesn’t work with phrase matching, common terms, or cross_fields matches.

You could probably get close with a set of Span queries

The span_multi query allows you to wrap a multi term query (one of wildcard, fuzzy, prefix, range or regexp query) as a span query, so it can be nested.

Span queries let you specify how far positionally child queries should be apart. So they can be used to build smarter phrase queries. In this case, you would need to do client side work preparse and organize a large span query with sub fuzzy queries for each term. More work, but doable.

(system) closed #3

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