Exemplo n.º 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void prepareIndex() throws java.io.IOException
        private void PrepareIndex()
        {
            using (IndexWriter writer = new IndexWriter(Dir, IndexWriterConfigs.standard()))
            {
                InsertRandomDocuments(writer);
            }
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @BeforeEach void initLuceneResources() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void InitLuceneResources()
        {
            _dirFactory = new Org.Neo4j.Kernel.Api.Impl.Index.storage.DirectoryFactory_InMemoryDirectoryFactory();
            Directory dir = _dirFactory.open(_testDir.directory("test"));

            _writer          = new IndexWriter(dir, IndexWriterConfigs.standard());
            _searcherManager = new SearcherManager(_writer, true, new SearcherFactory());
        }
Exemplo n.º 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void samplingOfLargeNumericValues() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void SamplingOfLargeNumericValues()
        {
            using (RAMDirectory dir = new RAMDirectory(), WritableIndexPartition indexPartition = new WritableIndexPartition(new File("testPartition"), dir, IndexWriterConfigs.standard()))
            {
                InsertDocument(indexPartition, 1, long.MaxValue);
                InsertDocument(indexPartition, 2, int.MaxValue);

                indexPartition.MaybeRefreshBlocking();

                using (PartitionSearcher searcher = indexPartition.AcquireSearcher())
                {
                    NonUniqueLuceneIndexSampler sampler = new NonUniqueLuceneIndexSampler(searcher.IndexSearcher, _taskControl.newInstance(), new IndexSamplingConfig(Config.defaults()));

                    assertEquals(new IndexSample(2, 2, 2), sampler.SampleIndex());
                }
            }
        }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void openWriter() throws java.io.IOException
        private void OpenWriter()
        {
            _writer = new IndexWriter(_directory, IndexWriterConfigs.transactionState(_index.Analyzer));
        }
Exemplo n.º 5
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: protected org.neo4j.graphdb.ResourceIterator<java.io.File> makeSnapshot() throws java.io.IOException
        protected internal override ResourceIterator <File> MakeSnapshot()
        {
            _indexWriter = new IndexWriter(Dir, IndexWriterConfigs.standard());
            return(LuceneIndexSnapshots.ForIndex(IndexDir, _indexWriter));
        }