예제 #1
0
        private void AddItemToIndex(AbstactDocument doc, IndexWriter writer)
        {
            var query = new BooleanQuery();
            query.Add(new TermQuery(new Term("Id", doc.Id.ToString())), Occur.MUST);
            query.Add(new TermQuery(new Term("Type", doc.Type)), Occur.MUST);

            writer.DeleteDocuments(query);
            writer.AddDocument(doc.Document);
        }
예제 #2
0
 private void DeleteItemFromIndex(AbstactDocument doc, IndexWriter writer)
 {
     var query = new TermQuery(new Term("Id", doc.Id.ToString()));
     writer.DeleteDocuments(query);
 }