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

Martijn van Groningen commented on SOLR-2523:
---------------------------------------------

Maybe I don't get something then. Let's take a look at the following example.
{code:xml}
     <lst name="facet_ranges">
      <lst name="manufacturedate_dt">
        <lst name="counts">
          <int name="2005-02-13T15:26:37Z">4</int>
          <int name="2006-02-13T15:26:37Z">7</int>
          <int name="2007-02-13T15:26:37Z">1</int>
        </lst>
        <str name="gap">+1YEAR</str>
        <date name="start">2005-02-13T15:26:37Z</date>
        <date name="end">2009-02-13T15:26:37Z</date>
      </lst>
    </lst>
{code}
For the first facet I need the following fq:
manufacturedate_dt:[2005-02-13T15:26:37Z TO 2006-02-13T15:26:37Z}
I can get this from parsing the date of the first facet and then the second 
one. This works fine for this example. However this wouldn't work in all cases. 
For example when dealing with last facet count or when not all facets are 
returned and the next facet is a few gaps ahead (for example when 
facet.mincount=1). I think I do need to use the gap then, right?


> SolrJ QueryResponse doesn't support range facets
> ------------------------------------------------
>
>                 Key: SOLR-2523
>                 URL: https://issues.apache.org/jira/browse/SOLR-2523
>             Project: Solr
>          Issue Type: Improvement
>          Components: clients - java
>            Reporter: Martijn van Groningen
>            Assignee: Martijn van Groningen
>            Priority: Trivial
>             Fix For: 3.3, 4.0
>
>         Attachments: SOLR-2523.patch, SOLR-2523.patch
>
>
> It is possible to get date facets and pivot facets in SolrJ.
> {code:java}
> queryResponse.getFacetDate();
> queryResponse.getFacetPivot();
> {code}
> Having this also for range fields would be nice. Adding this is trivial. 
> Maybe we should deprecate date facet methods in QueryResponse class? Since it 
> is superseded by range facets. Also some set / add / remove methods for 
> setting facet range parameters on the SolrQuery class would be nice.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to