java - Lucene TextField not tokenized -
i saving following title index
doc.add(new textfield(title, "button",field.store.yes ));
then when search "butto", nothing returns. must search "button" back. have substring of button gives result? using
standardanalyzer analyzer = new standardanalyzer();
the standardanalyzer
creates token button
input text , so, query button
matches document. search substring of button, have 2 options.
at search-time, can use different query, e.g. prefixquery or wildcardquery. if use query parser, can use butto?
or butto*
.
at index-time, can use different analyzer, emits substrings tokens, example edgengramtokenizer emit [bu, but, butt, butto, button]
based on configuration; or ngramtokenizer, emit [bu, ut, tt, to, on]
, on configured size(s).
Comments
Post a Comment