1

I have a the following surround query searching in the solr field content.

 _query_:"{!surround maxBasicQueries=10000} content:5N(tru*,(equi* OR and*))

How do I submit a query which is ORed or ANDed with multiple fields. Is something like this possible with Surround QueryParser? where I can search two fields simultaneously.

query:"{!surround maxBasicQueries=10000} AND (content:5N(tru*,(equi* OR and*)),examples:10N(em*,rit*))

Yauza
  • 180
  • 1
  • 13
  • What do you mean by that? Something like `5N(content:tru*,(content:equi* OR otherfield:and*))` doesn't make any sense (can't be within five words if it's in an entirely different field), so what are you looking for? – femtoRgon Feb 20 '17 at 16:11
  • @femtoRgon updated the question with a detailed example, Its basically my need to search multiple fields in one surround query – Yauza Feb 21 '17 at 09:50

1 Answers1

1

You could just issue two surround queries, one for each field. Then, you could combine them as you like. Remember you can split parts of queries into separate variables to make them easier to manage.

Also, you seem to be using wildcards to do prefix queries. You may want to look into using EdgeNGrams filter instead in the indexing phase. It makes your index large, but the searches faster.

Alexandre Rafalovitch
  • 9,709
  • 1
  • 24
  • 27