I've searched everywhere but still breaking my head on the wall... I'll
explain quickly my situation:

 

we have some items with 1:n (multiple) "availabilities" stored as IdObj,
PeriodFrom and PeriodTo columns in a Sql Database table. we need to import
items in Solr index and to filter them through their availability. reading
about the new DateRangeField supported from Solr 5, we've upgraded to it.
now the problem is that I don't know how to combine the PeriodFrom and
PeriodTo columns from Sql and to pass that values to Solr to make the tdate
field read and index them. actually in my data-config.xml I've tried
something like:

 

<entity...>

<field... />

<field... />

 

<entity name="charter" query="select '[' + CONVERT(VARCHAR(10), PeriodFrom,
126) + ' TO ' + CONVERT(VARCHAR(10), PeriodTo, 126) + ']' as Availability
from Solr.CharterAvail where IdObj ='${yvboats.BoatID}' order by
PeriodFrom">

     <field column="Availability" name="CharterData_BoatAvail" />

</entity>

 

Hoping to obtain something like [2014-05-01 TO 2014-07-04] .

 

and in the schema.xml

 

<field name="CharterData_BoatAvail" type="tdate" indexed="true"
stored="true" multiValued="true"/>

 

but the item is skipped from the solr indexer probably because he cannot
transform the [2014-05-01 TO 2014-07-04] string input into a Solr
DateRangeField

 

I'd be very very happy and thankful if anyone could suggest me the way to
get out of this stuck!!!

 

Thanks in advance

 

p.s. : assuming the magic will work :-), should I search into the Solr index
like this: q={f=dateRange op=Contains v="[1999 TO 2001]"} ?

 

 

Federico Colla

Webmaster presso Digibusiness Srl

federico.co...@digibusiness.it

Reply via email to