Ejemplo n.º 1
0
 public void RegisterTransactWriter(string key, TransactIndexWriter wr)
 {
     if (IsInTransaction)
     {
         Writers[key]   = wr;
         wr.Transaction = this;
     }
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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;
        }
Ejemplo n.º 5
0
        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;
        }