public new IQueryable <TItem> GetQueryable <TItem>(params IExecutionContext[] executionContexts)
        {
            LinqToLuceneIndexWithSpatial <TItem> linqToLuceneIndex = new LinqToLuceneIndexWithSpatial <TItem>(this, executionContexts);

            if (settings.EnableSearchDebug())
            {
                ((IHasTraceWriter)linqToLuceneIndex).TraceWriter = new LoggingTraceWriter(SearchLog.Log);
            }
            QueryGlobalFiltersArgs args = new QueryGlobalFiltersArgs(linqToLuceneIndex.GetQueryable(), typeof(TItem), executionContexts.ToList <IExecutionContext>());

            this.Index.Locator.GetInstance <ICorePipeline>().Run("contentSearch.getGlobalLinqFilters", args);
            return((IQueryable <TItem>)args.Query);
        }
        public IQueryable <TItem> GetQueryable <TItem>(params IExecutionContext[] executionContexts)
        {
            var linqToAzureIndex = new LinqToAzureIndex <TItem>(this, executionContexts);
            //if (Settings.EnableSearchDebug())
            //linqToAzureIndex.TraceWriter = new LoggingTraceWriter(SearchLog.Log);
            var queryable = linqToAzureIndex.GetQueryable();

            if (typeof(TItem).IsAssignableFrom(typeof(AzureSearchResultItem)))
            {
                var globalFiltersArgs = new QueryGlobalFiltersArgs(linqToAzureIndex.GetQueryable(), typeof(TItem), Enumerable.ToList(executionContexts));
                this.Index.Locator.GetInstance <ICorePipeline>().Run("contentSearch.getGlobalLinqFilters", globalFiltersArgs);
                queryable = (IQueryable <TItem>)globalFiltersArgs.Query;
            }
            return(queryable);
        }
        public static IQueryable <TItem> GetExtendedQueryable <TItem>(this IProviderSearchContext context, params IExecutionContext[] executionContexts)
        {
            Assert.ArgumentNotNull(context, "context");
            var solrContext = context as SolrSearchContext;

            Assert.IsNotNull(solrContext, "context is not SolrSearchContext");

            var index = new LinqToSolrIndexExtended <TItem>(solrContext, executionContexts);

            if (Settings.GetBoolSetting("ContentSearch.EnableSearchDebug", false))
            {
                (index as IHasTraceWriter).TraceWriter = new LoggingTraceWriter(SearchLog.Log);
            }
            QueryGlobalFiltersArgs args = new QueryGlobalFiltersArgs(index.GetQueryable(), typeof(TItem), executionContexts.ToList <IExecutionContext>());

            solrContext.Index.Locator.GetInstance <Sitecore.Abstractions.ICorePipeline>().Run("contentSearch.getGlobalLinqFilters", args);
            return((IQueryable <TItem>)args.Query);
        }
        public new IQueryable <TItem> GetQueryable <TItem>(params IExecutionContext[] executionContexts)
        {
            var linqToSolrIndex = new LinqToSolrIndexWithSpatial <TItem>(this, executionContexts);

            if (this.contentSearchSettings.EnableSearchDebug())
            {
                ((IHasTraceWriter)linqToSolrIndex).TraceWriter = new LoggingTraceWriter(SearchLog.Log);
            }

            var queryable = linqToSolrIndex.GetQueryable();

            if (typeof(TItem).IsAssignableFrom(typeof(SearchResultItem)))
            {
                var globalFiltersArgs = new QueryGlobalFiltersArgs(linqToSolrIndex.GetQueryable(), typeof(TItem), executionContexts.ToList());
                this.Index.Locator.GetInstance <ICorePipeline>().Run("contentSearch.getGlobalLinqFilters", globalFiltersArgs);
                queryable = (IQueryable <TItem>)globalFiltersArgs.Query;
            }
            return(queryable);
        }
        public override IQueryable <TItem> GetQueryable <TItem>(params IExecutionContext[] executionContexts)
        {
            var linqToSolrIndex = new Sitecore.Spatial.GeoJson.Providers.Solr.LinqToSolrIndex <TItem>(this, executionContexts);

            if (this.settings.EnableSearchDebug())
            {
                ((IHasTraceWriter)linqToSolrIndex).TraceWriter = new LoggingTraceWriter(SearchLog.Log);
            }

            var queryable = ((Index <TItem, SolrCompositeQuery>)linqToSolrIndex).GetQueryable();

            if (typeof(TItem).IsAssignableFrom(typeof(SearchResultItem)))
            {
                var queryGlobalFiltersArgs = new QueryGlobalFiltersArgs(queryable, typeof(TItem), executionContexts.ToList());
                this.Index.Locator.GetInstance <BaseCorePipelineManager>().Run("contentSearch.getGlobalLinqFilters", queryGlobalFiltersArgs);
                queryable = (IQueryable <TItem>)queryGlobalFiltersArgs.Query;
            }

            return(queryable);
        }