How can you have a multiple ranges in a solr query when a normal query (q) is used instead of filter query (fq). I looked at answers in here Multiple ranges in a facet in solr, but they seem not to work when a normal query is used like this: q=pageviews:([200 TO 250] OR [500 TO 550]), or pageviews:[200 TO 250] OR pageviews:[500 TO 550]. Tried both, but they do not seem to work with the solr I have. One difference I find is that my solr only accepts normal queries instead of filter queries.
Asked
Active
Viewed 998 times
1
-
1q=pageviews:([200 TO 250] OR [500 TO 550]) this seems to work for me. I used another field in one my Solr servers to test it. What is fieldType for pageviews? – jay May 28 '15 at 23:41
-
The type of the field is long. Here's its schema:
– Ville Miekk-oja May 29 '15 at 11:36 -
When you say it does not work, do you mean it gives 0 results? or it gives incorrect results? Note that you are doing a range query on a multi valued field. You will probably see results that you are not expecting. Example:
230 1000 . Do you expect this to be in your result? because your first range will match it, but the second one does not. -
When I query with multiple ranges, it gives all the results, as it would if no "last_modified" parameter would be given. – Ville Miekk-oja Jun 01 '15 at 07:12
-
Also, even the multivalued=true, all the data seems to have only one value, at least according to query results. – Ville Miekk-oja Jun 01 '15 at 07:31
-
Can you try indexing your data with multivalued=false and then try running the query? – jay Jun 03 '15 at 07:24