internal override void Remove(TxDataHolder holder, EntityId entityId, string key, object value) { try { EnsureLuceneDataInstantiated(); long id = entityId.Id(); Document document = FindDocument(id); if (document != null) { Index.type.removeFromDocument(document, key, value); if (LuceneDataSource.DocumentIsEmpty(document)) { _writer.deleteDocuments(Index.type.idTerm(id)); } else { _writer.updateDocument(Index.type.idTerm(id), document); } } InvalidateSearcher(); } catch (IOException e) { throw new Exception(e); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private void applyDocuments(org.apache.lucene.index.IndexWriter writer, IndexType type, org.eclipse.collections.api.map.primitive.LongObjectMap<DocumentContext> documents) throws java.io.IOException private void ApplyDocuments(IndexWriter writer, IndexType type, LongObjectMap <DocumentContext> documents) { foreach (DocumentContext context in documents) { if (context.Exists) { if (LuceneDataSource.DocumentIsEmpty(context.Document)) { writer.deleteDocuments(type.IdTerm(context.EntityId)); } else { writer.updateDocument(type.IdTerm(context.EntityId), context.Document); } } else { writer.addDocument(context.Document); } } }