Searching for a phrase in proximity to another tok

2019-08-22 11:44发布

问题:

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.



标签: solr