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 Paweł Gdula <gd...@gmail.com> on 2014/06/26 00:33:30 UTC

Sorting date fields

Hey

I try to sort my documents over creation date

<field name="created" type="date" indexed="true" stored="false"
multiValued="false"/>
<fieldType name="date" class="solr.TrieDateField" precisionStep="0"
positionIncrementGap="0"/>

I see that result is affected by sorting order (ASC/DESC change order) but
result is not precise. For example for query

params={mm=2&pf=tags^10+title^5&sort=created+asc&q=query&qf=tags^10+title^5&wt=javabin&version=2&defType=edismax&rows=10}

result is like:

2007-05-14
2007-08-13
2007-05-13
2008-03-26
2008-03-19
2007-07-02
...

general direction is ascending but between singe documents it fluctuate. Is
there any way to get strict ordering? Can anybody point me/explain me
current behavior?

Best

Pawel

Re: Sorting date fields

Posted by Chris Hostetter <ho...@fucit.org>.
: I see that result is affected by sorting order (ASC/DESC change order) but
: result is not precise. For example for query
: 
: params={mm=2&pf=tags^10+title^5&sort=created+asc&q=query&qf=tags^10+title^5&wt=javabin&version=2&defType=edismax&rows=10}

those results don't really make sense -- can you please show us the full & 
complete output you see in your browser from this query...

mm=2&pf=tags^10+title^5&sort=created+asc&q=query&qf=tags^10+title^5&defType=edismax&rows=10&fl=id,created&wt=json&indent=true&echoParams=all


-Hoss
http://www.lucidworks.com/