3 // SearchableDocument.cs: Abstracts our model of document from the Lucene Document
5 // Author: Mario Sopena
7 using Lucene.Net.Documents;
11 struct SearchableDocument
21 public string FullTitle {
25 public string HotText {
33 public string Examples {
37 public SearchableDocument Reset ()
39 Title = Url = FullTitle = HotText = Text = Examples = null;
43 public Document LuceneDoc {
45 Document doc = new Document ();
46 doc.Add (UnIndexed ("title", Title));
47 doc.Add (UnIndexed ("url", Url));
48 doc.Add (UnIndexed ("fulltitle", FullTitle ?? string.Empty));
49 doc.Add (UnStored ("hottext", HotText));
50 doc.Add (UnStored ("text", Text));
51 doc.Add (UnStored ("examples", Examples));
56 static Field UnIndexed(System.String name, System.String value_Renamed)
58 return new Field(name, value_Renamed, Field.Store.YES, Field.Index.NO);
61 static Field UnStored(System.String name, System.String value_Renamed)
63 return new Field(name, value_Renamed, Field.Store.NO, Field.Index.ANALYZED);