Create

Create()

Creates a new index in memory.

public Index Create()

Return Value

The created index.

Remarks

The repository does not dispose of the index: dispose of it when it is no longer needed, see Dispose.

Examples

The example demonstrates how to create an index in memory through the index repository.

IndexRepository indexRepository = new IndexRepository();
Index index = indexRepository.Create();

See Also


Create(IndexSettings)

Creates a new index in memory.

public Index Create(IndexSettings settings)
Parameter Type Description
settings IndexSettings The index settings.

Return Value

The created index.

Remarks

The repository does not dispose of the index: dispose of it when it is no longer needed, see Dispose.

Examples

The example demonstrates how to create an index in memory through the index repository.

IndexRepository indexRepository = new IndexRepository();

IndexSettings settings = new IndexSettings();
settings.UseStopWords = false; // Disabling use of stop words during indexing

Index index = indexRepository.Create(settings);

See Also


Create(string)

Creates a new index on disk. The index folder will be cleaned before the index creation.

public Index Create(string indexFolder)
Parameter Type Description
indexFolder String The index folder.

Return Value

The created index.

Exceptions

exception condition
IOException Another Index object uses the folder, in this process or in another one, or an index is saved or updated into the folder at the moment.

Remarks

The repository does not dispose of the index: dispose of it when it is no longer needed, see Dispose.

Examples

The example demonstrates how to create an index on disk through the index repository.

string indexFolder = @"c:\MyIndex\";

IndexRepository indexRepository = new IndexRepository();
Index index = indexRepository.Create(indexFolder);

See Also


Create(string, IndexSettings)

Creates a new index on disk. The index folder will be cleaned before the index creation.

public Index Create(string indexFolder, IndexSettings settings)
Parameter Type Description
indexFolder String The index folder.
settings IndexSettings The index settings.

Return Value

The created index.

Exceptions

exception condition
IOException Another Index object uses the folder, in this process or in another one, or an index is saved or updated into the folder at the moment.

Remarks

The repository does not dispose of the index: dispose of it when it is no longer needed, see Dispose.

Examples

The example demonstrates how to create an index on disk through the index repository.

string indexFolder = @"c:\MyIndex\";

IndexRepository indexRepository = new IndexRepository();

IndexSettings settings = new IndexSettings();
settings.UseStopWords = false; // Disabling use of stop words during indexing

Index index = indexRepository.Create(indexFolder, settings);

See Also