Beispiel #1
0
        public void UpdateSearchAppliance(ICollection <ISearchIndexEntry> entries, ICollection <UpdateItemReference> updatedItems = null, ISearchConfig config = null, bool waitForCompletion = false)
        {
            var currentEntries = entries;
            var currentItems   = updatedItems ?? entries.Select(e => new UpdateItemReference {
                ContentUdi = Udi.Parse(e.ObjectID)
            }).ToList();
            var currentConfig = config as IAlgoliaSearchConfig ?? _algoliaSearchConfig;

            if (waitForCompletion)
            {
                try
                {
                    var src = new CancellationTokenSource();
                    UpdateSearchAppliance(src.Token, currentEntries, currentItems, currentConfig).Wait();
                }
                catch (Exception ex)
                {
                    _logger.Error <AlgoliaSearchApplianceService>(ex, "Could not update search appliance");
                }
            }
            else
            {
                HostingEnvironment.QueueBackgroundWorkItem(async t =>
                {
                    try
                    {
                        await UpdateSearchAppliance(t, currentEntries, currentItems, currentConfig);
                    }
                    catch (Exception ex)
                    {
                        _logger.Error <AlgoliaSearchApplianceService>(ex, "Could not update search appliance");
                    }
                });
            }
        }
Beispiel #2
0
 public Indexer(ISearchConfig config)
 {
     _indexConfig = config;
 }
Beispiel #3
0
 public SearchApplianceExtension(ISearchConfig searchConfig, ISearchApplianceService searchApplianceService, ISearchIndexEntryHelper searchIndexEntryHelper)
 {
     _searchConfig           = searchConfig;
     _searchApplianceService = searchApplianceService;
     _searchIndexEntryHelper = searchIndexEntryHelper;
 }
Beispiel #4
0
 public SearchService(ISearchConfig config, IMapper mapper)
 {
     _config = Check.NotNull(config, nameof(config));
     _mapper = Check.NotNull(mapper, nameof(mapper));
 }
Beispiel #5
0
 public IdoxSearcher(INamedInstanceResolver <IIdoxConfig> configResolver, ISystemConfig systemConfig, ISearchConfig searchConfig, ILogger logger)
 {
     _systemConfig   = systemConfig;
     _searchConfig   = searchConfig;
     _configResolver = configResolver;
     _logger         = logger;
 }
Beispiel #6
0
 public void Search(string query, ISearchConfig config)
 {
     _ = EverythingDll.Everything_SetSearchW(query);
     ConfigureDll(config);
     EverythingDll.Everything_QueryW(true);
 }
Beispiel #7
0
 public Searcher(ISearchConfig searchConfig)
 {
     _searchConfig = searchConfig;
 }