Gets or sets a document filter. The DocumentFilter works on the inclusion logic. Use the DocumentFilter class for creation of document filter instances. The default value is null, which means that all added documents are indexed.
publicDocumentFilterDocumentFilter{get;set;}
Property Value
The document filter.
Remarks
The value can be changed at any time. A value changed after an index was created with these settings is saved in the index by the next operation that changes the index.
Examples
The example demonstrates how to set the document filter.
stringindexFolder=@"c:\MyIndex\";stringdocumentsFolder=@"c:\MyDocuments\";// Creating a filter that skips documents with extensions '.doc', '.docx', '.rtf'IndexSettingssettings=newIndexSettings();DocumentFilterfileExtensionFilter=DocumentFilter.CreateFileExtension(".doc",".docx",".rtf");// Creating file extension filterDocumentFilterinvertedFilter=DocumentFilter.CreateNot(fileExtensionFilter);// Inverting file extension filtersettings.DocumentFilter=invertedFilter;// Creating an index in the specified folderIndexindex=newIndex(indexFolder,settings);// Indexing documentsindex.Add(documentsFolder);// SearchingSearchResultresult=index.Search("Einstein");