protected internal override void Remove(long nodeId) { try { outerInstance.Writer.deleteDocuments(LuceneDocumentStructure.NewTermForChangeOrRemove(nodeId)); } catch (IOException e) { throw new UncheckedIOException(e); } }
protected internal override void AddIdempotent(long nodeId, Value[] values) { try { outerInstance.Writer.updateDocument(LuceneDocumentStructure.NewTermForChangeOrRemove(nodeId), LuceneDocumentStructure.DocumentRepresentingProperties(nodeId, values)); } catch (IOException e) { throw new UncheckedIOException(e); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void updateMultiplePartitionedIndex() throws java.io.IOException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: internal virtual void UpdateMultiplePartitionedIndex() { using (SchemaIndex index = LuceneSchemaIndexBuilder.Create(_descriptor, _config).withFileSystem(_fileSystem).withIndexRootFolder(_testDir.directory("partitionedIndexForUpdates")).build()) { index.create(); index.open(); AddDocumentToIndex(index, 45); index.IndexWriter.updateDocument(LuceneDocumentStructure.NewTermForChangeOrRemove(100), LuceneDocumentStructure.DocumentRepresentingProperties(( long )100, Values.intValue(100))); index.maybeRefreshBlocking(); long documentsInIndex = Iterators.count(index.allDocumentsReader().GetEnumerator()); assertEquals(46, documentsInIndex, "Index should contain 45 added and 1 updated document."); } }