Reputation: 4480
I want to write Solr query for something as below :
apple w/5 pear - apple must occur within 5 words of pear
How i can achieve the same ? Is their any regex for same ?
Upvotes: 0
Views: 53
Reputation: 1308
This can be done by enclosing the terms in quotations and using a tilde to indicate proximity:
q="apple pear"~5
If just the quotations are present, that is the same as ~0, that is, they should be next to each other.
Upvotes: 1