Beispiel #1
0
 private void InitializeForQuery(int totalItemsToFetch)
 {
     this.DiagnosticsSession.TraceDebug <int>("Creating CrawlerIterator with selection criteria for default model. Batch Size = {0}", totalItemsToFetch);
     this.FolderIterator = new SentItemsTrainingSubDocumentGenerator.SentItemsFolderIterator();
     this.ItemIterator   = new CrawlerItemIterator <ExDateTime>(this.FolderIterator, totalItemsToFetch, ItemSchema.SentTime, (object[] values) => ObjectClass.IsMessage(values[0] as string, false), new PropertyDefinition[]
     {
         StoreObjectSchema.ItemClass
     });
 }
 public CrawlerItemIterator(ICrawlerFolderIterator folderIterator, int maxRowCount, PropertyDefinition sortProperty, Predicate <object[]> filterPredicate, params PropertyDefinition[] predicateProperties)
 {
     Util.ThrowOnNullArgument(folderIterator, "folderIterator");
     Util.ThrowOnNullArgument(sortProperty, "sortProperty");
     if (filterPredicate != null)
     {
         Util.ThrowOnNullArgument(predicateProperties, "predicateProperties");
     }
     else if (predicateProperties != null && predicateProperties.Length > 0)
     {
         throw new ArgumentException("Predicate properties should not be specified when there's no filter supplied.");
     }
     this.folderIterator      = folderIterator;
     this.maxRowCount         = Math.Min(maxRowCount, 10000);
     this.sortProperty        = sortProperty;
     this.filterPredicate     = filterPredicate;
     this.predicateProperties = predicateProperties;
     this.diagnosticsSession  = DiagnosticsSession.CreateComponentDiagnosticsSession("CrawlerItemIterator", ComponentInstance.Globals.Search.ServiceName, ExTraceGlobals.MdbCrawlerFeederTracer, (long)this.GetHashCode());
 }