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 kirsty <ki...@gmail.com> on 2010/08/19 07:31:56 UTC

Date sorting

Hi I hope someone can point out what I am doing wrong.
I have a date field in my schema
<field name="PublishDate" type="date" indexed="true" stored="true" />

and I am trying to do a sort on it
example url: 
...select/?sort=PublishDate
asc&qt=FinCompanyCodeSearch&rows=20&fq=CompanyCode:1TM&fl=CompanyCode%20Title%20PublishDate

This works for the most part, but if I keep looking down my results list
returned by the search I have some random date and then it's back to sorting
again. 

http://lucene.472066.n3.nabble.com/file/n1219372/SolrSortIssue.jpg 

Looking at the above image you can see the dates seem to be in order, then I
get a 2010-08-17 date between the 2010-07 dates. This is just a sample..but
my full results continues like that.

I am not sure what I am doing wrong and would appreciate any help.
Thanks
Kirsty

-- 
View this message in context: http://lucene.472066.n3.nabble.com/Date-sorting-tp1219372p1219372.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Date sorting

Posted by "Grijesh.singh" <pi...@gmail.com>.
lance, is there any Bug in solr1.4 related to sorting on date field?
-- 
View this message in context: http://lucene.472066.n3.nabble.com/Date-sorting-tp1219372p1219537.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Date sorting

Posted by Lance Norskog <go...@gmail.com>.
Wow. Can you try upgrading to 1.4.1 and re-indexing?

On Wed, Aug 18, 2010 at 10:35 PM, kirsty <ki...@gmail.com> wrote:
>
> Sorry forgot to mention that I am using SOLR 1.4
> and using the dismax query type.
>
>
>
> kirsty wrote:
>>
>> Hi I hope someone can point out what I am doing wrong.
>> I have a date field in my schema
>> <field name="PublishDate" type="date" indexed="true" stored="true" />
>>
>> and I am trying to do a sort on it
>> example url:
>> ...select/?sort=PublishDate
>> asc&qt=FinCompanyCodeSearch&rows=20&fq=CompanyCode:1TM&fl=CompanyCode%20Title%20PublishDate
>>
>> This works for the most part, but if I keep looking down my results list
>> returned by the search I have some random date and then it's back to
>> sorting again.
>>
>>  http://lucene.472066.n3.nabble.com/file/n1219372/SolrSortIssue.jpg
>>
>> Looking at the above image you can see the dates seem to be in order, then
>> I get a 2010-08-17 date between the 2010-07 dates. This is just a
>> sample..but my full results continues like that.
>>
>> I am not sure what I am doing wrong and would appreciate any help.
>> Thanks
>> Kirsty
>>
>>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Date-sorting-tp1219372p1219377.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
Lance Norskog
goksron@gmail.com

Re: Date sorting

Posted by kirsty <ki...@gmail.com>.
Sorry forgot to mention that I am using SOLR 1.4 
and using the dismax query type.



kirsty wrote:
> 
> Hi I hope someone can point out what I am doing wrong.
> I have a date field in my schema
> <field name="PublishDate" type="date" indexed="true" stored="true" />
> 
> and I am trying to do a sort on it
> example url: 
> ...select/?sort=PublishDate
> asc&qt=FinCompanyCodeSearch&rows=20&fq=CompanyCode:1TM&fl=CompanyCode%20Title%20PublishDate
> 
> This works for the most part, but if I keep looking down my results list
> returned by the search I have some random date and then it's back to
> sorting again. 
> 
>  http://lucene.472066.n3.nabble.com/file/n1219372/SolrSortIssue.jpg 
> 
> Looking at the above image you can see the dates seem to be in order, then
> I get a 2010-08-17 date between the 2010-07 dates. This is just a
> sample..but my full results continues like that.
> 
> I am not sure what I am doing wrong and would appreciate any help.
> Thanks
> Kirsty
> 
> 

-- 
View this message in context: http://lucene.472066.n3.nabble.com/Date-sorting-tp1219372p1219377.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Date sorting

Posted by Erick Erickson <er...@gmail.com>.
Whew! Thanks for bringing closure to that one, it looked ugly
at the start!

Best
Erick

On Thu, Aug 19, 2010 at 2:03 AM, kirsty <ki...@gmail.com> wrote:

>
>
> Grijesh.singh wrote:
> >
> > provide schema.xml and solrconfig.xml to dig the problem and by which
> > version of solr u have indexed the data?
> >
> My greatest apologies, I have seen my mistake! ...looks like someone had
> added a sort into the requestHandler on another date already...which I was
> not aware of, so it seems that was causing a conflict!
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Date-sorting-tp1219372p1219574.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Date sorting

Posted by kirsty <ki...@gmail.com>.

Grijesh.singh wrote:
> 
> provide schema.xml and solrconfig.xml to dig the problem and by which
> version of solr u have indexed the data?
> 
My greatest apologies, I have seen my mistake! ...looks like someone had
added a sort into the requestHandler on another date already...which I was
not aware of, so it seems that was causing a conflict!




-- 
View this message in context: http://lucene.472066.n3.nabble.com/Date-sorting-tp1219372p1219574.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Date sorting

Posted by "Grijesh.singh" <pi...@gmail.com>.
provide schema.xml and solrconfig.xml to dig the problem and by which version
of solr u have indexed the data?
-- 
View this message in context: http://lucene.472066.n3.nabble.com/Date-sorting-tp1219372p1219534.html
Sent from the Solr - User mailing list archive at Nabble.com.