FAQ
Dear all,

I'm a recent Lucene user and I'm looking for the best way to perform searches over long titles (ad titles on a website).

For example, if the following documents exist:

- TITLE, "Fender telecaster"
- TITLE, "Land rover defender"
- TITLE, "I sale a wonderful fender stratocaster"

When searching "fender", I'd like to get these three documents. I expect the same results with "fende*" or "*ender*" (I want to let the possibility to the final user to manually enter a "*" ).
When searching "I sale a wonderful fender stratocaster", I'd like to get the third document (easy to guess :-).

I think I cannot use the WildcardQuery because the term shouldn't start with "*" of "?". Should I use a QueryParser ? How can I do it ?

It would be great if you could help me,

Thanks in advance,
Tom

__________________________________________________
Do You Yahoo!?
En finir avec le spam? Yahoo! Mail vous offre la meilleure protection possible contre les messages non sollicités
http://mail.yahoo.fr Yahoo! Mail

Search Discussions

  • Daniel Noll at May 13, 2008 at 11:32 pm

    On Saturday 10 May 2008 20:32:42 legrand thomas wrote:
    I think I cannot use the WildcardQuery because the term shouldn't start
    with "*" of "?". Should I use a QueryParser ? How can I do it ?
    WildcardQuery does permit a wildcard at the front, it's just much slower.

    Also, QueryParser allows wildcards at the front, but you have to
    setAllowLeadingWildcard(true). At the end of the day it's still creating a
    WildcardQuery though.

    Daniel

    ---------------------------------------------------------------------
    To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
    For additional commands, e-mail: java-user-help@lucene.apache.org

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedMay 10, '08 at 10:33a
activeMay 13, '08 at 11:32p
posts2
users2
websitelucene.apache.org

2 users in discussion

Daniel Noll: 1 post Legrand thomas: 1 post

People

Translate

site design / logo © 2022 Grokbase