Lucene: Multi-word phrases as search terms

后端 未结 4 1415
我寻月下人不归
我寻月下人不归 2020-12-03 15:46

I\'m trying to make a searchable phone/local business directory using Apache Lucene.

I have fields for street name, business name, phone number etc. The problem tha

4条回答
  •  一向
    一向 (楼主)
    2020-12-03 16:06

    There is no need of using any Analyzer here coz Hibernate implicitly uses StandardAnalyzer which will split the words based on white spaces so the solution here is set the Analyze to NO it will automatically performs Multi Phrase Search

     @Column(name="skill")
        @Field(index=Index.YES, analyze=Analyze.NO, store=Store.NO)
        @Analyzer(definition="SkillsAnalyzer")
        private String skill;
    

提交回复
热议问题