lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cheng <>
Subject Lucene suggester can't suggest similar phrase
Date Mon, 29 Sep 2014 16:51:11 GMT

I am using Lucene 4.10 suggester which I thought can return similar phrase.
But it turned out the different way.

My code is as follow:

public static void main(String[] args) throws IOException {

String path = "c:/data/suggest/dic.txt";

Dictionary dic;

dic = new FileDictionary(new FileInputStream(path));

InputIterator it = dic.getEntryIterator();

Analyzer analyzer = ERAnalyzer.getInstance().getAnalyzer();

FuzzySuggester suggester = new FuzzySuggester(analyzer);;

CharSequence cs = "雅诗兰黛";

List<LookupResult> results = suggester.lookup(cs, false, 1);



The dictionary contains only one line:

雅诗兰黛 50

When cs is exactly "雅诗兰黛", I get the result. But when cs is "雅思兰黛", which
is only one word different from the target, I get nothing back.

I tried FuzzySuggester as well as AnalyzingSuggester. The result is the

Did I miss something here?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message