lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <>
Subject Re: Appropriate analyzer
Date Wed, 22 Apr 2009 12:44:28 GMT
*If* your terms are simple (that is, not wildcarded), you may get
some joy from TermEnum. The idea here would be to find the
longest term *already in your index* that satisfies your need and
use that to form a simple TermQuery....

Essentially using TernEnum.skipTo on successively shorter
strings until it returned true...


On Tue, Apr 21, 2009 at 4:57 PM, Artyom Sokolov <> wrote:

> Hello.
> Currently I'm trying to find something like an analyzer to solve the
> problem.
> Actually, what I need is next: search on a query string step-by-step,
> trimming last char on each step. Small example:
> In index we've: abc, abcdef, xyz
> When search on abcdefgh the most relevant result should be abcdef, while
> searching on abcde the best one is abc.
> Thanks.
> Sincerely,
> Artyom Sokolov

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