Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lucene Fuzzy Match on Phrase instead of Single Word

I'm trying to do a fuzzy match on the Phrase "Grand Prarie" (deliberately misspelled) using Apache Lucene. Part of my issue is that the ~ operator only does fuzzy matches on single word terms and behaves as a proximity match for phrases.

Is there a way to do a fuzzy match on a phrase with lucene?

like image 758
Koobz Avatar asked Apr 06 '10 23:04

Koobz


People also ask

What is fuzzy search in Lucene?

FuzzyQuery is used to search documents using fuzzy implementation that is an approximate search based on the edit distance algorithm.

What does fuzzy matching do?

Fuzzy Matching (also called Approximate String Matching) is a technique that helps identify two elements of text, strings, or entries that are approximately similar but are not exactly the same.

What is fuzzy logic search?

A fuzzy search searches for text that matches a term closely instead of exactly. Fuzzy searches help you find relevant results even when the search terms are misspelled. To perform a fuzzy search, append a tilde (~) at the end of the search term.

What is fuzzy search in Solr?

Solr's standard query parser supports fuzzy searches based on the Damerau-Levenshtein Distance or Edit Distance algorithm. Fuzzy searches discover terms that are similar to a specified term without necessarily being an exact match. To perform a fuzzy search, use the tilde ~ symbol at the end of a single-word term.


1 Answers

Lucene 3.0 has ComplexPhraseQueryParser that supports fuzzy phrase query. This is in the contrib package.

like image 108
Shashikant Kore Avatar answered Sep 27 '22 22:09

Shashikant Kore