Hi,

Is this simply for returning a date string, or do you really need a full-blown 
Date object for your years?
I'd probably go with a "tint" field for the faceting on year, if year is the 
lowest date resolution you need.
If you need to convert 2008 to 2008-01-01T00:00:00Z to put into a real "date" 
field, then send it in from your client twice or write a UpdateProcessor to 
construct the date field based on the year field.

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com
Solr Training - www.solrtraining.com

On 24. aug. 2011, at 11:53, Oliver Schihin wrote:

> Hello list
> 
> My documents come with a field holding a date, always a year:
> <year>2008</year
> 
> In the schema, this content is taken for a field <year> as an integer, and it 
> will be searchable.
> 
> Through a copyfield-instruction I move the <year> to a <facet_year>-field, 
> you guess, to use it for faceting and make range queries possible. Its field 
> type is of the class 'solr.TrieDateField' that requires canonical date 
> representation. Is there a way in solr to extend the simple year to 
> <facet_year>2008-01-01T00:00:00Z</facet_year>. Or, do i have to solve the 
> problem in preprocessing, before posting?
> 
> Thanks
> Oliver

Reply via email to