How to have Solr autocomplete on whole phrase when query contains multiple terms?

后端 未结 3 1900
离开以前
离开以前 2021-01-30 12:12

I\'ve looked through a ton of examples and other questions here and from them, I\'ve got my config very close to what I need but I\'m missing one last little bit that I\'m havin

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-30 12:27

    Found the answer, finally! I knew I was really close. Turns out my configuration above was correct and I simply needed to change my query.

    1. Use KeywordTokenizerFactory so that the strings get indexed as a whole.
    2. Use SpellCheckComponent for the request handler.
    3. The piece I was missing -- don't query with q= but with spellcheck.q=.

    Given the source strings noted above and a query of spellcheck.q=solar+gl this yields the desired results:

    solar glass
    solar globe
    

提交回复
热议问题