Searching for a phrase in proximity to another token in SOLR

对着背影说爱祢 提交于 2019-12-11 14:48:51

问题


The following is proximity search in SOLR:

"john josh"~12

But what is I wanted to search for josh token being close not to john, but to the expression "john smith"?

Is there a way to make something like this work:

"("john smith") josh"~12


回答1:


Check these two parsers:

  1. ComplexPhraseQueryParser
  2. XMLQueryParser

I think the first one should do what you need, and maybe both can.



来源:https://stackoverflow.com/questions/49010974/searching-for-a-phrase-in-proximity-to-another-token-in-solr

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!