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 marotosg <ma...@gmail.com> on 2016/10/28 09:38:57 UTC

sorting by date not working on dates earlier than EPOCH

Hi all,

I just noticed than sorting on dates is not working as I am expecting.
When I sort ascending by a field of type date. I get first dates earlier
than EPOCH, then null and last dates later than EPOCH.

sample
response: {
numFound: 2052,
start: 0,
docs: [
{
ClosedDateSFD: "1901-01-01T00:00:00Z"
},
{
ClosedDateSFD: "1901-01-01T00:00:00Z"
},
{
ClosedDateSFD: "1929-10-01T00:00:00Z"
},
{ },
{ },
{
ClosedDateSFD: "1995-10-01T00:00:00Z"
},
{
ClosedDateSFD: "1996-10-01T00:00:00Z"
},

Is there any solution for this issue? Or any workroung anyon is using.

Thanks a lot
Sergio



--
View this message in context: http://lucene.472066.n3.nabble.com/sorting-by-date-not-working-on-dates-earlier-than-EPOCH-tp4303456.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: sorting by date not working on dates earlier than EPOCH

Posted by marotosg <ma...@gmail.com>.
Hi there.
I have found a possible solution for this issue.

<field name="fieldName" type="date" indexed="true" stored="true"
sortMissingLast="true" sortMissingFirst="false" />   





--
View this message in context: http://lucene.472066.n3.nabble.com/sorting-by-date-not-working-on-dates-earlier-than-EPOCH-tp4303456p4305770.html
Sent from the Solr - User mailing list archive at Nabble.com.