Lucene.Net.Index.IndexWriterConfig.SetOpenMode C# (CSharp) Method

SetOpenMode() public method

Specifies OpenMode of the index.

Only takes effect when IndexWriter is first created.

public SetOpenMode ( OpenMode_e openMode ) : IndexWriterConfig
openMode OpenMode_e
return IndexWriterConfig
        public IndexWriterConfig SetOpenMode(OpenMode_e? openMode)
        {
            if (openMode == null)
            {
                throw new System.ArgumentException("openMode must not be null");
            }
            this.openMode = openMode;
            return this;
        }

Usage Example

Ejemplo n.º 1
0
        private static IndexWriter GetWriter(Directory directory)
        {
            MergePolicy       policy = new LogByteSizeMergePolicy();
            IndexWriterConfig conf   = new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random));

            conf.SetMergePolicy(policy);
            conf.SetOpenMode(OpenMode.CREATE_OR_APPEND);

            IndexWriter writer = new IndexWriter(directory, conf);

            return(writer);
        }
All Usage Examples Of Lucene.Net.Index.IndexWriterConfig::SetOpenMode