public class IndexSettings extends Object
Learn more
The example demonstrates a typical usage of the class.
String indexFolder = "c:\\MyIndex\\";
IndexSettings settings = new IndexSettings();
settings.setIndexType(IndexType.CompactIndex); // Setting the index type
Index index = new Index(indexFolder, settings); // Creating an index
| Constructor and Description |
|---|
IndexSettings()
Initializes a new instance of the
IndexSettings class. |
| Modifier and Type | Method and Description |
|---|---|
CustomExtractorCollection |
getCustomExtractors()
Gets the custom extractor collection.
|
DocumentFilter |
getDocumentFilter()
Gets a document filter.
|
IndexType |
getIndexType()
Gets the index type.
|
boolean |
getInMemoryIndex()
Gets a value indicating whether the index is stored in memory or on disk.
|
ILogger |
getLogger()
Gets a logger that is used for logging events and errors in the index.
|
int |
getMaxIndexingReportCount()
Gets the maximum number of indexing reports.
|
int |
getMaxSearchReportCount()
Gets the maximum number of search reports.
|
NumberOfThreads |
getSearchThreads()
Gets the number of threads used for the search.
|
TextStorageSettings |
getTextStorageSettings()
Gets the text storage settings.
|
boolean |
getUseCharacterReplacements()
Gets a value indicating whether to use character replacements or not.
|
boolean |
getUseStopWords()
Gets a value indicating whether to use stop words or not.
|
protected static boolean |
isReadOnly(IndexSettings settings) |
void |
setDocumentFilter(DocumentFilter value)
Sets a document filter.
|
void |
setIndexType(IndexType value)
Sets the index type.
|
void |
setLogger(ILogger value)
Sets a logger that is used for logging events and errors in the index.
|
void |
setMaxIndexingReportCount(int value)
Sets the maximum number of indexing reports.
|
void |
setMaxSearchReportCount(int value)
Sets the maximum number of search reports.
|
void |
setSearchThreads(NumberOfThreads value)
Sets the number of threads used for the search.
|
void |
setTextStorageSettings(TextStorageSettings value)
Sets the text storage settings.
|
void |
setUseCharacterReplacements(boolean value)
Sets a value indicating whether to use character replacements or not.
|
void |
setUseStopWords(boolean value)
Sets a value indicating whether to use stop words or not.
|
public IndexSettings()
IndexSettings class.public final CustomExtractorCollection getCustomExtractors()
GroupDocs.Search.Common.IFieldExtractor interface.public final DocumentFilter getDocumentFilter()
DocumentFilter works on the inclusion logic.
Use the DocumentFilter class for creation a document filter instance.
The default value is null, which means that all added documents are indexed.The example demonstrates how to set the document filter.
String indexFolder = "c:\\MyIndex\\";
String documentsFolder = "c:\\MyDocuments\\";
// Creating a filter that skips documents with extensions '.doc', '.docx', '.rtf'
IndexSettings settings = new IndexSettings();
DocumentFilter fileExtensionFilter = DocumentFilter.createFileExtension(".doc", ".docx", ".rtf"); // Creating file extension filter
DocumentFilter invertedFilter = DocumentFilter.createNot(fileExtensionFilter); // Inverting file extension filter
settings.setDocumentFilter(invertedFilter);
// Creating an index in the specified folder
Index index = new Index(indexFolder, settings);
// Indexing documents
index.add(documentsFolder);
// Searching
SearchResult result = index.search("Einstein");
public final IndexType getIndexType()
GroupDocs.Search.Options.IndexType.NormalIndex.public final boolean getInMemoryIndex()
public final ILogger getLogger()
public final int getMaxIndexingReportCount()
5.public final int getMaxSearchReportCount()
10.public final NumberOfThreads getSearchThreads()
GroupDocs.Search.Options.NumberOfThreads.Default,
which means that the search will be performed using the number of threads equal to the number of processor cores.public final TextStorageSettings getTextStorageSettings()
null, which means that document texts are not stored.The example demonstrates how to set the text storage settings.
String indexFolder = "c:\\MyIndex\\";
String documentsFolder = "c:\\MyDocuments\\";
// Creating index settings instance
IndexSettings settings = new IndexSettings();
settings.setTextStorageSettings(new TextStorageSettings(Compression.High)); // Setting high compression level for the index text storage
// Creating an index in the specified folder
Index index = new Index(indexFolder, settings);
// Indexing documents
index.add(documentsFolder);
// Searching
SearchResult result = index.search("Einstein");
public final boolean getUseCharacterReplacements()
false.public final boolean getUseStopWords()
true.protected static boolean isReadOnly(IndexSettings settings)
public final void setDocumentFilter(DocumentFilter value)
DocumentFilter works on the inclusion logic.
Use the GroupDocs.Search.Options.DocumentFilter class for creation of a document filter instances.
The default value is null, which means that all added documents are indexed.value - The document filter.
The example demonstrates how to set the document filter.
String indexFolder = "c:\\MyIndex\\";
String documentsFolder = "c:\\MyDocuments\\";
// Creating a filter that skips documents with extensions '.doc', '.docx', '.rtf'
IndexSettings settings = new IndexSettings();
DocumentFilter fileExtensionFilter = DocumentFilter.createFileExtension(".doc", ".docx", ".rtf"); // Creating file extension filter
DocumentFilter invertedFilter = DocumentFilter.createNot(fileExtensionFilter); // Inverting file extension filter
settings.setDocumentFilter(invertedFilter);
// Creating an index in the specified folder
Index index = new Index(indexFolder, settings);
// Indexing documents
index.add(documentsFolder);
// Searching
SearchResult result = index.search("Einstein");
public final void setIndexType(IndexType value)
GroupDocs.Search.Options.IndexType.NormalIndex.value - The index type.public final void setLogger(ILogger value)
value - A logger that is used for logging events and errors in the index.public final void setMaxIndexingReportCount(int value)
5.value - The maximum number of indexing reports.public final void setMaxSearchReportCount(int value)
10.value - The maximum number of search reports.public final void setSearchThreads(NumberOfThreads value)
GroupDocs.Search.Options.NumberOfThreads.Default,
which means that the search will be performed using the number of threads equal to the number of processor cores.value - The number of threads used for the search.public final void setTextStorageSettings(TextStorageSettings value)
null, which means that document texts are not stored.value - The text storage settings.
The example demonstrates how to set the text storage settings.
String indexFolder = "c:\\MyIndex\\";
String documentsFolder = "c:\\MyDocuments\\";
// Creating index settings instance
IndexSettings settings = new IndexSettings();
settings.setTextStorageSettings(new TextStorageSettings(Compression.High)); // Setting high compression level for the index text storage
// Creating an index in the specified folder
Index index = new Index(indexFolder, settings);
// Indexing documents
index.add(documentsFolder);
// Searching
SearchResult result = index.search("Einstein");
public final void setUseCharacterReplacements(boolean value)
false.value - A value indicating whether to use character replacements or not.public final void setUseStopWords(boolean value)
true.value - A value indicating whether to use stop words or not.Copyright © 2026. All rights reserved.