public ProductISearchIndexManager(ProductManager productManager,
                                   ProductSearchManager productSearchManager,
                                   ISearchIndexInfoProvider searchIndexInfoProvider,
                                   ISearchProviderFactory <Product> searchProviderFactory)
 {
     this.searchIndexInfoProvider = searchIndexInfoProvider;
     this.searchProviderFactory   = searchProviderFactory;
     this.productManager          = productManager;
     this.ProductSearchManager    = productSearchManager;
 }
Esempio n. 2
0
 /// <summary>
 /// Creates new instance of <see cref="SmartSearchIndexRebuildMiddleware"/>.
 /// </summary>
 /// <param name="next">
 /// The <see cref="RequestDelegate"/> representing the next middleware in the pipeline.
 /// </param>
 /// <param name="siteService">Site service.</param>
 /// <param name="searchIndexInfoProvider">Search index info provider.</param>
 public SmartSearchIndexRebuildMiddleware(RequestDelegate next,
                                          ISiteService siteService,
                                          ISearchIndexInfoProvider searchIndexInfoProvider,
                                          IEventLogService eventLogService)
 {
     this.next                    = next;
     this.siteService             = siteService;
     this.searchIndexInfoProvider = searchIndexInfoProvider;
     this.eventLogService         = eventLogService;
 }
Esempio n. 3
0
        public ProductSearchManager(ProductManager productManager, ISearchIndexInfoProvider searchIndexInfoProvider, ISearchProviderFactory <Product> searchProviderFactory)
        {
            this.productManager          = productManager;
            this.searchIndexInfoProvider = searchIndexInfoProvider;
            this.searchProviderFactory   = searchProviderFactory;

            searchProvider = new Lazy <ISearchProvider <Product> >(() =>
            {
                var searchIndexInfo = searchIndexInfoProvider.GetCurrentSearchIndexInfo();

                if (searchIndexInfo == null)
                {
                    throw new InvalidOperationException("Cant get current search index info");
                }

                return(searchProviderFactory.GetProvider(searchIndexInfo.IndexFilesLocation));
            });
        }