i apache solr beginner. data-config.xml contains code
<entity name="event"> <field column="event_id" name="id" /> ... <entity name="request_history" query="select request_date, request_expiry_date request_history id=event.id"> <field column="request_date" name="start_date" /> <field column="request_expiry_date" name="expire_date" /> </entity>
and following in shcema.xml file against fields
<field name="start_date" type="tdate" indexed="true" stored="true" multivalued="true"/> <field name="expire_date" type="tdate" indexed="true" stored="true" multivalued="true"/>
so, single event, there can multiple requests hence multiple "start_date" , "expire_date". need find requests within date range , requests not within given date range, not getting way.
index start date , expiry single multivalued fields per event e.g. event_date
. rather clubbing them 2 fields.
each event have entry start date , expiry date combined , fq=start_date:[now *] , expire_date:[* now]
query work fine you.
make field dynamic don't need configure.
Comments
Post a Comment