public LinqToAzureIndex(AzureSearchContext context, IExecutionContext executionContext) : this(context, new IExecutionContext[1] { executionContext }) { }
//private MapFieldSelector fieldSelector; public AzureSearchResults(AzureSearchContext context, AzureQuery query, DocumentSearchResult searchHits, int startIndex, int endIndex, SelectMethod selectMethod, IEnumerable <IExecutionContext> executionContexts, IEnumerable <IFieldQueryTranslator> virtualFieldProcessors, FieldNameTranslator fieldNameTranslator) { this.context = context; this.query = query; this.searchHits = searchHits; this.startIndex = startIndex; this.endIndex = endIndex; this.selectMethod = selectMethod; this.virtualFieldProcessors = virtualFieldProcessors; this.fieldNameTranslator = fieldNameTranslator; this.configuration = (AzureIndexConfiguration)context.Index.Configuration; //this.fieldSelector = (MapFieldSelector)null; this.executionContexts = executionContexts; var executionContext = this.executionContexts != null?Enumerable.FirstOrDefault <IExecutionContext>(this.executionContexts, (Func <IExecutionContext, bool>)(c => c is OverrideExecutionContext <IIndexDocumentPropertyMapper <Document> >)) as OverrideExecutionContext <IIndexDocumentPropertyMapper <Document> > : (OverrideExecutionContext <IIndexDocumentPropertyMapper <Document> >)null; this.mapper = (executionContext != null ? executionContext.OverrideObject : null) ?? this.configuration.IndexDocumentPropertyMapper; //if (selectMethod != null && selectMethod.FieldNames != null && selectMethod.FieldNames.Length > 0) //{ // this.fieldSelector = this.GetMapFieldSelector(context, (IEnumerable<string>)selectMethod.FieldNames); //} //else //{ // if (this.selectMethod != null) // return; // IEnumerable<string> documentFieldsToRead = this.mapper.GetDocumentFieldsToRead<TElement>(executionContexts); // this.fieldSelector = this.GetMapFieldSelector(context, documentFieldsToRead); //} }
public LinqToAzureIndex(AzureSearchContext context, IExecutionContext[] executionContexts) : base(new AzureIndexParameters(context.Index.Configuration.IndexFieldStorageValueFormatter, context.Index.Configuration.VirtualFields, context.Index.FieldNameTranslator, (fieldName => context.Index.Configuration.FieldMap.GetFieldConfiguration(fieldName) as IAzureSearchFieldConfiguration), executionContexts, context.Index.Configuration.FieldMap, context.ConvertQueryDatesToUtc)) { Assert.ArgumentNotNull(context, "context"); settings = context.Index.Locator.GetInstance <IContentSearchConfigurationSettings>(); pipeline = context.Index.Locator.GetInstance <ICorePipeline>(); this.context = context; }
public LinqToAzureIndex(AzureSearchContext context) : this(context, (IExecutionContext[])null) { }