Index Constructor (String, IndexSettings, Boolean) |
Initializes a new instance of the
Index class.
Loads an existing index from disk if
overwriteIfExists is
false;
creates a new index on disk with particular index settings otherwise.
Namespace: GroupDocs.SearchAssembly: GroupDocs.Search (in GroupDocs.Search.dll) Version: 21.2
Syntaxpublic Index(
string indexFolder,
IndexSettings settings,
bool overwriteIfExists
)
Public Sub New (
indexFolder As String,
settings As IndexSettings,
overwriteIfExists As Boolean
)
public:
Index(
String^ indexFolder,
IndexSettings^ settings,
bool overwriteIfExists
)
new :
indexFolder : string *
settings : IndexSettings *
overwriteIfExists : bool -> Index
Parameters
- indexFolder
- Type: SystemString
The index folder path. - settings
- Type: GroupDocs.SearchIndexSettings
The index settings object. - overwriteIfExists
- Type: SystemBoolean
The flag of overwriting the index folder.
Examples
The example demonstrates how to create an index on a disk with particular index settings.
string indexFolder = @"c:\MyIndex\";
IndexSettings settings = new IndexSettings();
settings.IndexType = IndexType.CompactIndex;
Index index = new Index(indexFolder, settings, true);
See Also