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 Vincenzo D'Amore <v....@gmail.com> on 2017/04/24 09:24:52 UTC

Working with Dates - More DateRangeField Details

Hi All,

I was reading the Apache Solr Reference Guide - Working with Dates

https://cwiki.apache.org/confluence/display/solr/Working+with+Dates#WorkingwithDates-MoreDateRangeFieldDetails

And I found this filter query pretty interesting for me, so I was trying to
use it with a TrieDateField

fq={!field f=Data_Ingresso op=Contains}[2013 TO 2018]

<fieldType name="date" class="solr.TrieDateField" sortMissingLast="true"
omitNorms="true" />
<field name="Data_Ingresso" type="date" indexed="true" stored="true"
multiValued="false" />

But trying the example I get this error:

Invalid Date String:'[2013 TO 2018]'

Could someone please help me to understand in what I'm wrong?

Best regards,
Vincenzo

-- 
Vincenzo D'Amore
email: v.damore@gmail.com
skype: free.dev
mobile: +39 349 8513251

Re: Working with Dates - More DateRangeField Details

Posted by Vincenzo D'Amore <v....@gmail.com>.
Thanks for your suggestion :)

On Mon, Apr 24, 2017 at 3:08 PM, Shawn Heisey <ap...@elyograg.org> wrote:

> On 4/24/2017 3:24 AM, Vincenzo D'Amore wrote:
> > https://cwiki.apache.org/confluence/display/solr/Working+with+Dates#
> WorkingwithDates-MoreDateRangeFieldDetails
> >
> > And I found this filter query pretty interesting for me, so I was trying
> to
> > use it with a TrieDateField
> >
> > fq={!field f=Data_Ingresso op=Contains}[2013 TO 2018]
> >
> > <fieldType name="date" class="solr.TrieDateField" sortMissingLast="true"
> > omitNorms="true" />
> > <field name="Data_Ingresso" type="date" indexed="true" stored="true"
> > multiValued="false" />
> >
> > But trying the example I get this error:
> >
> > Invalid Date String:'[2013 TO 2018]'
>
> This kind of range works with DateRangeField, it does *not* work with
> TrieDateField.  You're going to have to completely reindex after you
> change the class on your fieldType and reload the collection or core.
>
> https://wiki.apache.org/solr/HowToReindex
>
> Thanks,
> Shawn
>
>


-- 
Vincenzo D'Amore
email: v.damore@gmail.com
skype: free.dev
mobile: +39 349 8513251

Re: Working with Dates - More DateRangeField Details

Posted by Shawn Heisey <ap...@elyograg.org>.
On 4/24/2017 3:24 AM, Vincenzo D'Amore wrote:
> https://cwiki.apache.org/confluence/display/solr/Working+with+Dates#WorkingwithDates-MoreDateRangeFieldDetails
>
> And I found this filter query pretty interesting for me, so I was trying to
> use it with a TrieDateField
>
> fq={!field f=Data_Ingresso op=Contains}[2013 TO 2018]
>
> <fieldType name="date" class="solr.TrieDateField" sortMissingLast="true"
> omitNorms="true" />
> <field name="Data_Ingresso" type="date" indexed="true" stored="true"
> multiValued="false" />
>
> But trying the example I get this error:
>
> Invalid Date String:'[2013 TO 2018]'

This kind of range works with DateRangeField, it does *not* work with
TrieDateField.  You're going to have to completely reindex after you
change the class on your fieldType and reload the collection or core.

https://wiki.apache.org/solr/HowToReindex

Thanks,
Shawn