public static void AddUpdateLuceneIndex(Tag c) { AddUpdateLuceneIndex(new List<Tag> { c }); }
private static void _addToLuceneIndex(Tag com, IndexWriter writer) { var searchQuery = new TermQuery(new Term("Id", com.Id.ToString())); writer.DeleteDocuments(searchQuery); var doc = new Document(); doc.Add(new Field("Id", com.Id.ToString(), Field.Store.YES, Field.Index.ANALYZED)); doc.Add(new Field("TagName", com.TagName, Field.Store.YES, Field.Index.ANALYZED)); writer.AddDocument(doc); }