hey, i'm trying to search for documents that has date value. my problem is that i'm trying to search for all the documents that "happen" this month but it return me nothing.
var eventCriteria = ExamineManager.Instance.SearchProviderCollection["MySearcher"].CreateSearchCriteria(UmbracoExamine.IndexTypes.Content);
DateTime firstDayOfTheMonth = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
DateTime lastDayOfTheMonth = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).AddMonths(1).AddDays(-1);
var eventFilter = eventCriteria.Range("eventDate", firstDayOfTheMonth, lastDayOfTheMonth).Compile();
EventSearchResults = ExamineManager.Instance.SearchProviderCollection["MySearcher"].Search(eventFilter);
Examine Range
hey, i'm trying to search for documents that has date value.
my problem is that i'm trying to search for all the documents that "happen" this month but it return me nothing.
Eran,
Looks like you have similar issue http://our.umbraco.org/forum/using/ui-questions/16888-Examine-Search-Range-Values also see http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Range Searches it may be you just need to get the dates formatted correctly as string eg
thank you, i will try it.
this format didn't do the trick, but formating the string as yyyy-MM-dd did the trick and it's working
is working on a reply...