//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void updateReader(org.neo4j.kernel.impl.api.KernelTransactionImplementation kti) throws Exception
        private void UpdateReader(KernelTransactionImplementation kti)
        {
            _modifiedEntityIdsInThisTransaction.clear();               // Clear this so we don't filter out entities who have had their changes reversed since last time.
            _writer.resetWriterState();
            AllStoreHolder   read             = ( AllStoreHolder )kti.DataRead();
            TransactionState transactionState = kti.TxState();

            using (NodeCursor nodeCursor = _visitingNodes ? kti.Cursors().allocateNodeCursor() : null, RelationshipScanCursor relationshipCursor = _visitingNodes ? null : kti.Cursors().allocateRelationshipScanCursor(), PropertyCursor propertyCursor = kti.Cursors().allocatePropertyCursor())
            {
                transactionState.Accept(_txStateVisitor.init(read, nodeCursor, relationshipCursor, propertyCursor));
            }
            FulltextIndexReader baseReader         = ( FulltextIndexReader )read.IndexReader(_descriptor, false);
            FulltextIndexReader nearRealTimeReader = _writer.NearRealTimeReader;

            _currentReader      = new TransactionStateFulltextIndexReader(baseReader, nearRealTimeReader, _modifiedEntityIdsInThisTransaction);
            _lastUpdateRevision = kti.TransactionDataRevision;
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public ScoreEntityIterator query(org.neo4j.kernel.api.KernelTransaction ktx, String indexName, String queryString) throws org.neo4j.internal.kernel.api.exceptions.schema.IndexNotFoundKernelException, org.apache.lucene.queryparser.classic.ParseException
        public override ScoreEntityIterator Query(KernelTransaction ktx, string indexName, string queryString)
        {
            KernelTransactionImplementation kti = ( KernelTransactionImplementation )ktx;
            AllStoreHolder      allStoreHolder  = ( AllStoreHolder )kti.DataRead();
            IndexReference      indexReference  = kti.SchemaRead().indexGetForName(indexName);
            FulltextIndexReader fulltextIndexReader;

            if (kti.HasTxStateWithChanges() && !((FulltextSchemaDescriptor)indexReference.Schema()).EventuallyConsistent)
            {
                FulltextAuxiliaryTransactionState auxiliaryTxState = ( FulltextAuxiliaryTransactionState )allStoreHolder.AuxiliaryTxState(TX_STATE_PROVIDER_KEY);
                fulltextIndexReader = auxiliaryTxState.IndexReader(indexReference, kti);
            }
            else
            {
                IndexReader indexReader = allStoreHolder.IndexReader(indexReference, false);
                fulltextIndexReader = ( FulltextIndexReader )indexReader;
            }
            return(fulltextIndexReader.Query(queryString));
        }