public IndexWriter CreateWriter() { var storeDirectoryKey = String.Format("{0}#{1}", StoreDirectory.GetHashCode(), StoreDirectory.ToString()); if (Transaction != null && Transaction.IsInTransaction && Transaction.GetTransactWriter(storeDirectoryKey) != null) { return(Transaction.GetTransactWriter(storeDirectoryKey)); } var indexExists = IndexReader.IndexExists(StoreDirectory); var indexWriter = new TransactIndexWriter(StoreDirectory, Analyzer, !indexExists, IndexWriter.MaxFieldLength.UNLIMITED); indexWriter.SetUseCompoundFile(UseCompoundFile); if (Transaction != null) { Transaction.RegisterTransactWriter(storeDirectoryKey, indexWriter); } return(indexWriter); }
public IndexWriter CreateWriter() { var indexDir = ResolveLocalIndexPath(); if (Transaction != null && Transaction.IsInTransaction && Transaction.GetTransactWriter(indexDir) != null) { return(Transaction.GetTransactWriter(indexDir)); } var indexExists = IndexReader.IndexExists(indexDir); var indexWriter = new TransactIndexWriter(ResolveLocalIndexPath(), Analyzer, !indexExists, IndexWriter.MaxFieldLength.UNLIMITED); indexWriter.SetUseCompoundFile(UseCompoundFile); if (Transaction != null) { Transaction.RegisterTransactWriter(indexDir, indexWriter); } return(indexWriter); }
public IndexWriter CreateWriter() { var storeDirectoryKey = String.Format("{0}#{1}", StoreDirectory.GetHashCode(), StoreDirectory.ToString() ); if (Transaction != null && Transaction.IsInTransaction && Transaction.GetTransactWriter(storeDirectoryKey) != null) return Transaction.GetTransactWriter(storeDirectoryKey); var indexExists = IndexReader.IndexExists(StoreDirectory); var indexWriter = new TransactIndexWriter(StoreDirectory, Analyzer, !indexExists, IndexWriter.MaxFieldLength.UNLIMITED); indexWriter.SetUseCompoundFile(UseCompoundFile); if (Transaction != null) { Transaction.RegisterTransactWriter(storeDirectoryKey, indexWriter); } return indexWriter; }
public IndexWriter CreateWriter() { var indexDir = ResolveLocalIndexPath(); if (Transaction != null && Transaction.IsInTransaction && Transaction.GetTransactWriter(indexDir)!=null) return Transaction.GetTransactWriter(indexDir); var indexExists = IndexReader.IndexExists(indexDir); var indexWriter = new TransactIndexWriter(ResolveLocalIndexPath(), Analyzer, !indexExists, IndexWriter.MaxFieldLength.UNLIMITED); indexWriter.SetUseCompoundFile(UseCompoundFile); if (Transaction != null) { Transaction.RegisterTransactWriter(indexDir, indexWriter); } return indexWriter; }