Ejemplo n.º 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void removeFromCache(long entityId) throws java.io.IOException
        private void RemoveFromCache(long entityId)
        {
            IndexSearcher searcher = _searcherManager.acquire();

            try
            {
                Query   query = _type.idTermQuery(entityId);
                TopDocs docs  = searcher.search(query, 1);
                if (docs.totalHits > 0)
                {
                    Document document = searcher.doc(docs.scoreDocs[0].doc);
                    foreach (IndexableField field in document.Fields)
                    {
                        string key   = field.name();
                        object value = field.stringValue();
                        RemoveFromCache(entityId, key, value);
                    }
                }
            }
            finally
            {
                _searcherManager.release(searcher);
            }
        }
Ejemplo n.º 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void runUniquenessVerification(org.neo4j.storageengine.api.NodePropertyAccessor nodePropertyAccessor, org.apache.lucene.search.IndexSearcher indexSearcher) throws java.io.IOException, org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException
        private void RunUniquenessVerification(NodePropertyAccessor nodePropertyAccessor, IndexSearcher indexSearcher)
        {
            try
            {
                PartitionSearcher partitionSearcher = mock(typeof(PartitionSearcher));
                when(partitionSearcher.IndexSearcher).thenReturn(indexSearcher);

                using (UniquenessVerifier verifier = new SimpleUniquenessVerifier(partitionSearcher))
                {
                    verifier.Verify(nodePropertyAccessor, _propertyKeyIds);
                }
            }
            finally
            {
                _searcherManager.release(indexSearcher);
            }
        }