0

I want to create a custom index for query datetime range (Event datetime) in sitecore content search (SOLR). I want to store datetime ranges like

 2010-01-01 - 2010-02-02
 2010-02-02 - 2011-03-21
....

and get items back as fast as possible. Is it possible to store multiple datetime ranges and use sitecore content search method to query for these items?

I create index field:

<field fieldName="Dates" returnType="tdate" multiValued="true" >Dummy.Core.Models.EventTime, Dummy.Core</field>

How can i implement a custom computed index ? Somebody knows some basic tutorial for multiple value and date time ranges? Thank you for your answers.

2
  • Why don't you store "Start Date" and "End Date" individually? then you can query for items within this range, Here is a similar question stackoverflow.com/a/21809659/1218297 Mar 20, 2015 at 12:18
  • There are multiple date times in the concept. There is an event like a movie. Dates : 2011-01-01 - 2011-01-30 2011-02-01 - 2011-02-22 I want to write an easy way to implement this and compress values to one field ( avoid big indexes ).
    – Chrissx
    Mar 20, 2015 at 12:21

1 Answer 1

0

One of the solution that i can think of it create schedule items under your event item, each schedule item has Start and End date, this way you can have as many schedules as possible, Then you can search on these schedules and get the parent item (Event).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.