You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Adi Neacsu <pa...@yahoo.co.uk> on 2010/06/23 21:23:11 UTC

Help with sorting

Hi everyone , 
I'm stuck in sorting with solr . I have documents of some 
institutions 
differentiated by an id named instanta . I indexed all those 
documents 
and among other things I put in the index the date  the document 
was 
created and the id of the institution .When I want sort the 
documents 
wich contain a certain word by date or by instituion all I get is 
an 
order that I don't understand . 

<field name="datecreated" type="date" indexed="true" stored="false" /> 
<field name="instanta" type="int" indexed="true" stored="false" 
required="true" /> 

 QueryOptions options = new QueryOptions 
        { 
            Rows = resultsPerPage, 
            Start = (pageNumber - 1) * resultsPerPage, 
            OrderBy = new[] { new SortOrder("instanta", Order.DESC) } 

        }; 

Thank you in advance 
 
jud. Adrian Neacsu
Presedinte Tribunalul Vrancea
http://www.adrianneacsu.jurindex.ro

www.jurisprudenta.org

www.societateapentrujustitie.ro
 (+40) 0721949875  ;  (+40) 0749182508  
fax 0337814221


      

Re: Help with sorting

Posted by Ahmet Arslan <io...@yahoo.com>.

> When I want sort the
> documents 
> wich contain a certain word by date or by instituion all I
> get is 
> an 
> order that I don't understand . 
> 
> <field name="datecreated" type="date" indexed="true"
> stored="false" /> 
> <field name="instanta" type="int" indexed="true"
> stored="false" 
> required="true" /> 

You need to use a sortable type: sint with solr 1.3; tint with solr 1.4

field name="instanta" type="tint"