Beispiel #1
0
        public static List <DynamicMessage> LoadNDocumentsFromIndex(int count)
        {
            List <DynamicMessage> messages = new List <DynamicMessage>();


            for (int i = viewerReadIndex; i < count + viewerReadIndex; i++)
            {
                Document      document;
                List <string> temp = new List <string>();
                if (i < LuceneService.DirReader.MaxDoc)
                {
                    document = LuceneService.DirReader.Document(i);
                }
                else
                {
                    break;
                }

                foreach (var field in ProjectInfo.Data.SelectedFields)
                {
                    temp.Add(document.GetField(field).GetStringValue());
                }

                DynamicMessage message = new DynamicMessage(temp, ProjectInfo.Data.SelectedFields, ProjectInfo.DateFieldKey, document.GetField("id").GetInt32Value().Value);
                messages.Add(message);
            }

            viewerReadIndex = count + viewerReadIndex;
            return(messages);
        }
Beispiel #2
0
 public static void RetrieveDictFromMessageContainer(DynamicMessage m)
 {
     foreach (var kvp in m.Situations)
     {
         if (!Index.ContainsKey(kvp.Key))
         {
             Index.Add(kvp.Key, new Dictionary <int, List <int> >());
         }
         if (!Index[kvp.Key].ContainsKey(kvp.Value))
         {
             Index[kvp.Key].Add(kvp.Value, new List <int>());
             Index[kvp.Key][kvp.Value].Add(m.Id);
         }
         else
         {
             Index[kvp.Key][kvp.Value].Add(m.Id);
         }
     }
 }