[ 
https://issues.apache.org/jira/browse/SOLR-2366?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13418298#comment-13418298
 ] 

Mandar commented on SOLR-2366:
------------------------------

        I have tried using the price range facet with three different ways, but 
was not able to get it working for variable gaps

        1) 
select/?q=*%3A*&facet=true&facet.query=minPrice:[*+TO+500]&facet.query=minPrice:[500+TO+*]

        Returns 
        <lst name="facet_queries">
                <int name="minPrice:[* TO 500]">122</int>
                <int name="minPrice:[500 TO *]">5722</int>
        </lst>

        2) 
/select?q=*%3A*&wt=xmlfacet=true&facet.field=minPrice&facet.range=minPrice&f.minPrice.facet.range.start=0&f.minPrice.facet.range.end=10000&f.minPrice.facet.range.gap=1000
        <lst name="minPrice">
                <lst name="counts">
                <int name="0">522</int>
                <int name="1000">1204</int>
                <int name="2000">1077</int>
                <int name="3000">817</int>
                <int name="4000">563</int>
                <int name="5000">302</int>
                <int name="6000">245</int>
                <int name="7000">324</int>
                <int name="8000">112</int>
                <int name="9000">200</int>
        </lst>

        3) 
/select?q=*%3A*&wt=xmlfacet=true&facet.field=minPrice&facet.range=minPrice&f.minPrice.facet.range.start=0&f.minPrice.facet.range.end=10000&f.minPrice.facet.range.gap=1000&facet.range.spec=0,1000,3000,5000

        There is no error, facet.range.spec with facet.range doesn't come back 
with expected facet results as above.
        Tried using version 3.6 & 4 alpha 

        Is there anything wrong with my query, for using range.spec

        I have even tried using f.minPrice.facet.range.gap=1000,2000,3000 and 
get parse error.

        Or is range.spec not a part of these versions.

                
> Facet Range Gaps
> ----------------
>
>                 Key: SOLR-2366
>                 URL: https://issues.apache.org/jira/browse/SOLR-2366
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Grant Ingersoll
>            Priority: Minor
>             Fix For: 4.1
>
>         Attachments: SOLR-2366.patch, SOLR-2366.patch
>
>
> There really is no reason why the range gap for date and numeric faceting 
> needs to be evenly spaced.  For instance, if and when SOLR-1581 is completed 
> and one were doing spatial distance calculations, one could facet by function 
> into 3 different sized buckets: walking distance (0-5KM), driving distance 
> (5KM-150KM) and everything else (150KM+), for instance.  We should be able to 
> quantize the results into arbitrarily sized buckets.
> (Original syntax proposal removed, see discussion for concrete syntax)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to