Example #1
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());
                }
            }
        }
Example #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static void insertDocument(org.neo4j.kernel.api.impl.index.partition.WritableIndexPartition partition, long nodeId, Object propertyValue) throws java.io.IOException
        private static void InsertDocument(WritableIndexPartition partition, long nodeId, object propertyValue)
        {
            Document doc = LuceneDocumentStructure.documentRepresentingProperties(nodeId, Values.of(propertyValue));

            partition.IndexWriter.addDocument(doc);
        }