{
struct SearchableDocument
{
- public string title;
- public string url;
- public string fulltitle;
- public string hottext;
- public string text;
- public string examples;
+ public string Title {
+ get; set;
+ }
+
+ public string Url {
+ get; set;
+ }
+
+ public string FullTitle {
+ get; set;
+ }
+
+ public string HotText {
+ get; set;
+ }
+
+ public string Text {
+ get; set;
+ }
+
+ public string Examples {
+ get; set;
+ }
public Document LuceneDoc {
get {
Document doc = new Document ();
- doc.Add (UnIndexed ("title", title));
- doc.Add (UnIndexed ("url", url));
- doc.Add (UnIndexed ("fulltitle", fulltitle ?? string.Empty));
- doc.Add (UnStored ("hottext", hottext));
- doc.Add (UnStored ("text", text));
- doc.Add (UnStored ("examples", examples));
+ doc.Add (UnIndexed ("title", Title));
+ doc.Add (UnIndexed ("url", Url));
+ doc.Add (UnIndexed ("fulltitle", FullTitle ?? string.Empty));
+ doc.Add (UnStored ("hottext", HotText));
+ doc.Add (UnStored ("text", Text));
+ doc.Add (UnStored ("examples", Examples));
return doc;
}
}
//Write to the Lucene Index all the parts
SearchableDocument doc = new SearchableDocument ();
- doc.title = title;
- doc.hottext = title.Substring (title.IndexOf (':'));
- doc.url = url;
- doc.text = text;
- doc.examples = examples;
+ doc.Title = title;
+ doc.HotText = title.Substring (title.IndexOf (':'));
+ doc.Url = url;
+ doc.Text = text;
+ doc.Examples = examples;
writer.AddDocument (doc.LuceneDoc);
if (node.IsLeaf)
XmlSerializer reader = new XmlSerializer (typeof (ErrorDocumentation));
ErrorDocumentation d = (ErrorDocumentation)reader.Deserialize (GetHelpStream (n.Element.Substring (6)));
SearchableDocument doc = new SearchableDocument ();
- doc.title = d.ErrorName;
- doc.url = n.Element;
- doc.text = d.Details != null ? d.Details.ToString () : string.Empty;
- doc.examples = d.Examples.Cast<string> ().Aggregate ((e1, e2) => e1 + Environment.NewLine + e2);
- doc.hottext = d.ErrorName;
+ doc.Title = d.ErrorName;
+ doc.Url = n.Element;
+ doc.Text = d.Details != null ? d.Details.ToString () : string.Empty;
+ doc.Examples = d.Examples.Cast<string> ().Aggregate ((e1, e2) => e1 + Environment.NewLine + e2);
+ doc.HotText = d.ErrorName;
writer.AddDocument (doc.LuceneDoc);
}
}