lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Moore <>
Subject Re: Suggestive Search
Date Wed, 08 Apr 2009 19:05:41 GMT
I use TermEnum for this sort of  "browsing" on untokenized, unstored 
fields e.g. TermEnum terms=reader.terms(new Term("mybrowsefld","harr")).
Matt Schraeder wrote:
> Corerct me if I'm wrong, but I don't think n-grams is really what I'm
> looking for here.  I'm not looking for a spellchecker or phrase checker
> style suggestive search, but only based on the exact phrases the user is
> currently typing.  Since Lucene uses term-based searching, I'm not sure
> how to have it search on portions of a full phrase.  Using a standard
> lucene search typing in "harr" will result in searching for "harr" as a
> term, which will not find "Harry Potter".  Using ngrams it would find
> "Harry" as a term, but not at the beginning of an entire phrase.  This
> would bring back "My Dog Harry" as a result, which isn't what I'm
> looking for. I just want phrases from fields beginning with "Harr"
> only.
> I could easily do this all with our database server by simply doing a
> query for "where searchqueries like 'harr%'" but we're trying to limit
> our hits to the database to keep speed up on the site.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message