private static void AddToLuceneIndex(LuceneSynonymData synonymData, IndexWriter writer)
        {
            // add new index entry
            var doc = new Document();

            // add lucene fields mapped to db fields
            doc.Add(new Field(nameof(LuceneSynonymData.Id), synonymData.Id.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED));
            doc.Add(new Field(nameof(LuceneSynonymData.Word), synonymData.Word, Field.Store.YES, Field.Index.ANALYZED));

            // add entry to index
            writer.AddDocument(doc);
        }
示例#2
0
 public void AddSynonyms(IEnumerable <string> words)
 {
     _luceneProxy.AddUpdateLuceneIndex(LuceneSynonymData.GetSynonymsGroup(words));
 }