Lucene.NET (fuzzy string match)

Can someone give me an example on how to fuzzy match two strings using Lucene.NET (either using the Java version of Lucene or in any other language with the Lucene port).

+6
c # lucene
source share
1 answer

Could you be more specific about what you mean by fuzzy matching?

Lucene offers fuzzy queries using the tilde operator (~) and wildcards (* and?) See here

If you want to compare a string distance of 2 lines using methods such as Levenshtein, Jaro-Winkler, etc., you are better off using a separate library such as SimMetrics . I use Simmetrics on my production site and it works fab.

SimMetricsMetricUtilities.Levenstein ls = new SimMetricsMetricUtilities.Levenstein(); //compare string 1, string 2 double sim = ls.GetSimilarity(string_1, string_2); if(sim > [some value]) { //do something } 
+5
source share

All Articles