Multiple ranges in verge in solr

How could you format the Solr boundary grid query to include two page view ranges?

Below is only the 200 TO 250 range and nothing from the 500 to 550 range.

 <str name="fq">pageviews:[200 TO 250] OR [500 TO 550]</str> 

I am interested in getting the number of entries that associate people with pageviews from 200 to 250 and from 500 to 550.

+1
source share
3 answers

Turns out I need to specify a field every time:

 pageviews:[200 TO 250] OR pageviews:[500 TO 550] 
+3
source

You can also use it as shown below.

 fq=pageviews:([200 TO 250] OR [500 TO 550]) 
+4
source

I believe that a complete answer to this question should include a way to configure all the parameters of these "repeating" faces. This is how it would be done in Solr 4.4.0 using JSON.

 "facet.range": [ "{!key=twohundred " + "f.pageviews.facet.range.start=200 " + "f.pageviews.facet.range.end=250 " + "f.pageviews.facet.range.gap=1 " + "}pageviews", "{!key=fivehundred " + "f.pageviews.facet.range.start=500 " + "f.pageviews.facet.range.end=550 " + "f.pageviews.facet.range.gap=10 " + "}pageviews" ] 

(Note that each entry in the array must be a line without line breaks, but are separated here for clarity.)

Thus, each facet can be individually marked, changed (I changed the space for "five hundred") or any other parameters can be added (for example, "facet.range.other").

Source: https://issues.apache.org/jira/browse/SOLR-1351

+3
source

Source: https://habr.com/ru/post/1440123/


All Articles