FAQ
Hi,

I've a company field in Lucene Index. One of the company names indexed is :
Moody's

When user types in any of the following keywords,I want this company to come
up in search results. 1.Moo 2.Mood 3.Moodys 4.Moody's

How should I store this index in Lucene and what type of Lucene Query should
I use to get this behaviour?

Thanks.

--
View this message in context: http://www.nabble.com/Storing-words-with-apostrophe-in-Lucene-index-tp24691019p24691019.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Search Discussions

  • AHMET ARSLAN at Jul 28, 2009 at 7:45 am

    When user types in any of the following keywords,I want
    this company to come up in search results.
    1.Moo 2.Mood 3.Moodys 4.Moody's

    How should I store this index in Lucene and what type of
    Lucene Query should I use to get this behavior?
    If you want to use a built-in analyzer WhitespaceAnalyzer with PrefixQuery are enough to get this behavior.
    Just add an star ( * ) end of the user query:

    Moo*
    Mood*
    Moodys*
    Moody's*

    Note that this option will be case sensitive.

    To perform case insensitive search either you can add LowerCaseFilter to WhitespaceAnalyzer, or remove StandardFilter from StandardAnalyzer.
    May be it is a good idea to setLowercaseExpandedTerms of your QueryParser to true, since wildcard query words are not analyzed.

    If you don't want to use wildcard searches, then EdgeNGramTokenFilter can help you.





    ---------------------------------------------------------------------
    To unsubscribe, e-mail: [email protected]
    For additional commands, e-mail: [email protected]

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedJul 28, '09 at 1:20a
activeJul 28, '09 at 7:45a
posts2
users2
websitelucene.apache.org

2 users in discussion

Mitu2009: 1 post AHMET ARSLAN: 1 post

People

Translate

site design / logo © 2023 Grokbase