Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

To Search a collection of dates



I am using Episerver Find and the version is 6R2.

It is an event that can be occured on multiple dates.

I have two filters DateFrom and DateEnd.

I have list of date collection on which the event can happen.

I need to create a find filter which can look into DateCollection and filter the result. I need to apply in range as well as match here.

The following query gives me an error:-

query = query.Filter(x => x.EventDatesCollection.Match(DateFrom));

"Cannot resolve method Match(system.datetime). It does not seem to match datetime field."

Can anyone share the idea, how can I implement this?

Many thanks


Jul 30, 2014 18:41

Hi Nazim,

There was a similar question on the forums not too long ago. But that used Nested2Find which I don't think is available for Find 1 (CMS 6 R2). But maybe you can use the source code to make it Find 1 compatible?

Jul 30, 2014 23:53


Thanks Toni very much for your reply, Here is the code where I am defining the Nested object.

//Custom class for EventOccurances defined

 public class EventOccurances
        public PageReference EventId{ get; set; }
        public DateTime EventDate { get; set; }

        public string Location
            get; set;

 // PageType defined where I am filling the nested collection

 public class EventPageType : BaseTypedPageData

        public virtual NestedList EventOccuranceCollection
                var eventOccuranceList = new NestedList();
                IEnumerable children = DataFactory.Instance.GetChildren(this.PageLink).Cast();
                foreach (var pd in children)
                    EventOccurances eventOcc = new EventOccurances();

                    if (pd.LocationName != null)
                        // eventOcc.EventId = pd.PageLink;
                        eventOcc.Location = pd.LocationName;

                    if (pd.EventDateTime != DateTime.MinValue)
                        eventOcc.EventDate = pd.EventDateTime;

                    if (eventOcc.Location != null || eventOcc.EventDate != DateTime.MinValue)

                return eventOccuranceList;  //Fill the nested list from the child pages only locations and dates


Now on the Search Results page:-

  SearchClient.Instance.Conventions.AddNestedConventions();  //Added the nested convention
  var query = SearchClient.Instance.Search();

if (!string.IsNullOrEmpty(Location))

                query = query.Filter(x => x.EventOccurances.MatchItem(p => p.Location.Match(Location)));

           var result = query.Select(x => new BaseSearchResult.SearchHit
                Title = x.PageName,
                Url = x.LinkURL(),
                Text = x.Description,
                PageList = x.PageaHierarchyList,
                PublishedDate = x.SearchPublishDate(),
                EventType = x.EventType,
                EventSubject = x.MastercourseSubject,
                PageDataForSearch = x.PageLink


It is throwing the same exception which is mentioned in the post you mentioned

The remote server returned an error: (400) Bad Request.

[nested] failed to find nested object under path [EventOccuranceCollection$$nested]]

On the Find Index parser:- it does not give me the value of collection as EventOccuranceCollection$$nested but as EventOccuranceCollection

property.PropertyName = property.PropertyName + "$$nested";  //this code is already definied in ModifyContract

Do you spot any problem in the code.
Did I miss anything? Why it is not adding nested keyword around it. Please if anyone can reply.

Many thanks,

Jul 31, 2014 13:46
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.