Ejemplo n.º 1
0
        private Document BuildDocument(IndexedDocument document)
        {
            var luceneDocument = new Document();

            luceneDocument.Add(new Field("id", document.Id.ToString(), Field.Store.YES, Field.Index.NOT_ANALYZED));
            luceneDocument.Add(new Field("displayvalue", document.DisplayValue, Field.Store.YES, Field.Index.ANALYZED));
            foreach (var category in document.Categories)
            {
                luceneDocument.Add(new Field("categoryid", category.ToString(), Field.Store.YES, Field.Index.ANALYZED));
            }

            return(luceneDocument);
        }
Ejemplo n.º 2
0
 public void AddDocument(IndexedDocument document)
 {
     this.Writer.AddDocument(BuildDocument(document));
     this.Writer.Commit();
 }