Gets the collection of date formats for date range search. The default date formats are ‘dd.MM.yyyy’, ‘MM/dd/yyyy’, and ‘yyyy-MM-dd’.
publicDateFormatCollectionDateFormats{get;}
Property Value
The collection of date formats for date range search.
Examples
The example demonstrates how to set the date formats for the search.
stringindexFolder=@"c:\MyIndex\";stringdocumentsFolder=@"c:\MyDocuments\";stringquery="Einstein";Indexindex=newIndex(indexFolder);// Creating an index in the specified folderindex.Add(documentsFolder);// Indexing documents from the specified folderSearchOptionsoptions=newSearchOptions();options.DateFormats.Clear();// Removing default date formatsDateFormatElement[]elements=newDateFormatElement[]{DateFormatElement.MonthTwoDigits,DateFormatElement.DayOfMonthTwoDigits,DateFormatElement.YearFourDigits,};// Creating a date format pattern 'MM/dd/yyyy'DateFormatdateFormat=newDateFormat(elements,"/");options.DateFormats.Add(dateFormat);SearchResultresult=index.Search(query,options);// Search in index