/// <summary> /// Initializes the index at the given index /// </summary> protected FSDirectory InitializeIndex(DirectoryInfo path, string indexName = null) { try { var directory = FSDirectory.Open(path.FullName); // Exit if the index already exists if (IndexReader.IndexExists(directory)) { return(directory); } // TODO:RB: re-add logging log.DebugFormat("Initialize index: '{0}'", path); var maxFieldLength = IndexWriter.MaxFieldLength.UNLIMITED; var policy = new KeepOnlyLastCommitDeletionPolicy(); using (var analyzer = new StandardAnalyzer(Environment.LuceneVersion)) using (var indexWriter = new IndexWriter(directory, analyzer, true, policy, maxFieldLength)) { // Do nothing, index writer's constructor has initialized the index log.Info("Index writer called to create directory" + path.FullName); indexWriter.Close(); } return(directory); } catch (IOException e) { throw new HibernateException("Unable to initialize index: " + indexName ?? path.FullName, e); } }
public LuceneDataProviderSettings() { EnableMultipleEntities = true; DeletionPolicy = new KeepOnlyLastCommitDeletionPolicy(); MaxFieldLength = IndexWriter.MaxFieldLength.UNLIMITED; MergeFactor = LogMergePolicy.DEFAULT_MERGE_FACTOR; RAMBufferSizeMB = IndexWriter.DEFAULT_RAM_BUFFER_SIZE_MB; }
public LuceneIndexCopy() { IndexDeletionPolicy policy = new KeepOnlyLastCommitDeletionPolicy(); _snapshotter = new SnapshotDeletionPolicy(policy); }
public UmbracoTempStorageIndexer() { IndexDeletionPolicy policy = new KeepOnlyLastCommitDeletionPolicy(); Snapshotter = new SnapshotDeletionPolicy(policy); }