You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Hoss Man (JIRA)" <ji...@apache.org> on 2010/03/11 03:09:27 UTC

[jira] Updated: (SOLR-1815) SolrJ doesn't preserve the order of facet queries returned from solr

     [ https://issues.apache.org/jira/browse/SOLR-1815?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hoss Man updated SOLR-1815:
---------------------------

    Description: 
Using Solrj, I wanted to sort the response of a range query based on some specific labels. For instance, using the query:

{noformat}
facet=true
&facet.query={!key= Less than 100}[* TO 99]
&facet.query={!key=100 - 200}[100 TO 200]
&facet.query={!key=200 +}[201 TO *]
{noformat}

I wanted to display the response in the following order:

{noformat}
Less than 100 (x)
100 - 200 (y)
201 + (z)
{noformat}

independently on the values of x, y, z which are the numbers of the retrieved documents for each range.

While Solr itself produces correctly the desired order (as specified in my query), SolrJ doesn't preserve it. 

RE: Yonik, a solution could be just to change
{code}
_facetQuery = new HashMap<String, Integer>();
    ...to...
_facetQuery = new Linked HashMap<String, Integer>();
{code}
 


  was:
Using Solrj, I wanted to sort the response of a range query based on some specific labels. For instance, using the query:

facet=true
&facet.query={!key= Less than 100}[* TO 99]
&facet.query={!key=100 - 200}[100 TO 200]
&facet.query={!key=200 +}[201 TO *]

I wanted to display the response in the following order:

Less than 100 (x)
100 - 200 (y)
201 + (z)

independently on the values of x, y, z which are the numbers of the retrieved documents for each range.

While Solr itself produces correctly the desired order (as specified in my query), SolrJ doesn't preserve it. 

RE: Yonik, a solution could be just to change

    _facetQuery = new HashMap<String, Integer>();
to
    _facetQuery = new Linked HashMap<String, Integer>();

 


     Issue Type: Bug  (was: Improvement)
        Summary: SolrJ doesn't preserve the order of facet queries returned from solr  (was: Sorting range queries: SolrJ doesn't preserve the order produced by Solr)

revising summary to clarify the problem, reclassifying as a bug, reformating description to include noformat & code tags so it doesn't try to render emoticons.

> SolrJ doesn't preserve the order of facet queries returned from solr
> --------------------------------------------------------------------
>
>                 Key: SOLR-1815
>                 URL: https://issues.apache.org/jira/browse/SOLR-1815
>             Project: Solr
>          Issue Type: Bug
>          Components: clients - java
>    Affects Versions: 1.4
>            Reporter: Steve Radhouani
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Using Solrj, I wanted to sort the response of a range query based on some specific labels. For instance, using the query:
> {noformat}
> facet=true
> &facet.query={!key= Less than 100}[* TO 99]
> &facet.query={!key=100 - 200}[100 TO 200]
> &facet.query={!key=200 +}[201 TO *]
> {noformat}
> I wanted to display the response in the following order:
> {noformat}
> Less than 100 (x)
> 100 - 200 (y)
> 201 + (z)
> {noformat}
> independently on the values of x, y, z which are the numbers of the retrieved documents for each range.
> While Solr itself produces correctly the desired order (as specified in my query), SolrJ doesn't preserve it. 
> RE: Yonik, a solution could be just to change
> {code}
> _facetQuery = new HashMap<String, Integer>();
>     ...to...
> _facetQuery = new Linked HashMap<String, Integer>();
> {code}
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.