/// <summary> /// This constructor is used while retrieving the hit from the dump /// </summary> /// <param name="ixr">The dump indexer this Wiki topic belongs to</param> /// <param name="hit">The Lucene Hit object</param> public PageInfo(Indexer ixr, Hit hit) { indexer = ixr; Document doc = hit.GetDocument(); TopicId = Convert.ToInt64(doc.GetField("topicid").StringValue()); Name = doc.GetField("title").StringValue(); Beginnings = new long[doc.GetFields("beginning").Length]; Ends = new long[doc.GetFields("end").Length]; int i = 0; foreach (byte[] binVal in doc.GetBinaryValues("beginning")) { Beginnings[i] = BitConverter.ToInt64(binVal, 0); i++; } i = 0; foreach (byte[] binVal in doc.GetBinaryValues("end")) { Ends[i] = BitConverter.ToInt64(binVal, 0); i++; } Array.Sort(Beginnings); Array.Sort(Ends); }
/// <summary> /// This constructor is used while retrieving the hit from the dump /// </summary> /// <param name="ltask">The dump indexer this Wiki topic belongs to</param> /// <param name="hit">The Lucene Hit object</param> public PageInfo(Indexer ixr, Hit hit) { TreatRedirectException = false; Indexer = ixr; // Decoder setter sort Beginnings and Ends. _decoder = ixr; Score = hit.GetScore(); Document doc = hit.GetDocument(); TopicId = Convert.ToInt64(doc.GetField("topicid").StringValue()); Name = doc.GetField("title").StringValue(); Beginnings = new long[doc.GetFields("beginning").Length]; Ends = new long[doc.GetFields("end").Length]; int i = 0; foreach (byte[] binVal in doc.GetBinaryValues("beginning")) { Beginnings[i] = BitConverter.ToInt64(binVal, 0); i++; } i = 0; foreach (byte[] binVal in doc.GetBinaryValues("end")) { Ends[i] = BitConverter.ToInt64(binVal, 0); i++; } Array.Sort(Beginnings); Array.Sort(Ends); }