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); }
protected virtual Sort GetSorting(AzureQuery query) { Assert.ArgumentNotNull(query, "query"); Sort sort = null; if (query.Methods != null) { var sortFieldArray = Enumerable.ToArray(Enumerable.Reverse(Enumerable.Select(Enumerable.Where(query.Methods, m => m.MethodType == QueryMethodType.OrderBy), (m => new SortField(((OrderByMethod)m).Field, GetSortFieldType((OrderByMethod)m), ((OrderByMethod)m).SortDirection == SortDirection.Descending))))); if (sortFieldArray.Length > 0) { sort = new Sort(sortFieldArray); if (settings.EnableSearchDebug()) { var stringBuilder = new StringBuilder(); foreach (var sortField in sortFieldArray) { stringBuilder.Append(sortField.Field.Replace("sortfield", string.Empty) + " "); } SearchLog.Log.Debug(string.Format("Sorting Azure query by{0}", stringBuilder), null); } } } return(sort); }