yotsov
yotsov

Reputation: 775

Searching for a phrase in proximity to another token in SOLR

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

Upvotes: 0

Views: 233

Answers (1)

Persimmonium
Persimmonium

Reputation: 15789

Check these two parsers:

  1. ComplexPhraseQueryParser
  2. XMLQueryParser

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

Upvotes: 1

Related Questions