SearchOptionsDateFormats Property |
Namespace: GroupDocs.Search.Options
string indexFolder = @"c:\MyIndex\"; string documentsFolder = @"c:\MyDocuments\"; string query = "Einstein"; Index index = new Index(indexFolder); // Creating an index in the specified folder index.Add(documentsFolder); // Indexing documents from the specified folder SearchOptions options = new SearchOptions(); options.DateFormats.Clear(); // Removing default date formats DateFormatElement[] elements = new DateFormatElement[] { DateFormatElement.MonthTwoDigits, DateFormatElement.DayOfMonthTwoDigits, DateFormatElement.YearFourDigits, }; // Creating a date format pattern 'MM/dd/yyyy' DateFormat dateFormat = new DateFormat(elements, "/"); options.DateFormats.Add(dateFormat); SearchResult result = index.Search(query, options); // Search in index