Exemplo n.º 1
0
 public WeightFirstSearcher(IConfiguration config, MetaSearcherConfig searcherConfig) : base(config, searcherConfig)
 {
     this.engines = base.GetEngineList()
                    .OrderBy(e => e.Weight);
     this.firstEngine = this.engines.FirstOrDefault();
     this.engines     = this.engines.Where(e => e.Name != this.firstEngine?.Name);
 }
Exemplo n.º 2
0
        public CustomSearcher(IConfiguration config, MetaSearcherConfig searcherConfig,
                              IOptions <CustomSearcherConfig> customSearcherConfig) : base(config, searcherConfig)
        {
            this.secondaryEngines = base.GetEngineList();
            this.firstEngines     = this.secondaryEngines.Where(e => IsAdvancedEngine(e.Name));
            this.secondaryEngines = this.secondaryEngines.Where(e => !IsAdvancedEngine(e.Name));

            bool IsAdvancedEngine(string name) => customSearcherConfig?.Value?.AdvancedList?.Contains(name) ?? false;
        }
Exemplo n.º 3
0
 public ParallelSearcher(IConfiguration config, MetaSearcherConfig searcherConfig) : base(config, searcherConfig)
 {
     this.engines = base.GetEngineList();
 }
Exemplo n.º 4
0
 public BaseMetaSearcher(IConfiguration config, MetaSearcherConfig searcherConfig)
 {
     this.config         = config;
     this.searcherConfig = searcherConfig;
     badUrls             = this.config["badurls"]?.Split(';');
 }