How to do query auto-completion/suggestions in Lucene?

后端 未结 5 1873
刺人心
刺人心 2020-11-27 09:35

I\'m looking for a way to do query auto-completion/suggestions in Lucene. I\'ve Googled around a bit and played around a bit, but all of the examples I\'ve seen seem to be s

5条回答
  •  自闭症患者
    2020-11-27 10:07

    You can use the class PrefixQuery on a "dictionary" index. The class LuceneDictionary could be helpful too.

    Take a look at this article linked below. It explains how to implement the feature "Did you mean ?" available in modern search engine such as Google. You may not need something as complex as described in the article. However the article explains how to use the Lucene spell package.

    One way to build a "dictionary" index would be to iterate on a LuceneDictionary.

    Hope it helps

    Did You Mean: Lucene? (page 1)

    Did You Mean: Lucene? (page 2)

    Did You Mean: Lucene? (page 3)

提交回复
热议问题