Exemple #1
0
        public LinqToElasticSearchIndex(ElasticSearchContext context, IExecutionContext executionContext) : base(new ElasticSearchIndexParameters(context.Index.Configuration.IndexFieldStorageValueFormatter, context.Index.Configuration.VirtualFieldProcessors, context.Index.FieldNameTranslator, executionContext))
        {
            Assert.ArgumentNotNull(context, "context");
            _context = context;
            var cultureContext = Parameters.ExecutionContext as CultureExecutionContext;
            var culture        = cultureContext == null?CultureInfo.GetCultureInfo(Settings.DefaultLanguage) : cultureContext.Culture;

            _cultureCode = culture.TwoLetterISOLanguageName;
            //((ElasticSearchFieldNameTranslator) Parameters.FieldNameTranslator).AddCultureContext(culture);
        }
 public ElasticSearchResults(ElasticSearchContext context, IQueryResponse <Dictionary <string, object> > searchResults, SelectMethod selectMethod, IEnumerable <IFieldQueryTranslator> virtualFieldProcessors)
 {
     _context = context;
     _elasticSearchIndexConfiguration = (ElasticSearchIndexConfiguration)_context.Index.Configuration;
     _mapper                 = (ElasticSearchDocumentPropertyMapper)_elasticSearchIndexConfiguration.IndexDocumentPropertyMapper;
     _selectMethod           = selectMethod;
     _virtualFieldProcessors = virtualFieldProcessors;
     _resultsTotal           = searchResults.Total;
     _searchResults          = ApplySecurity(searchResults, context.SecurityOptions, ref _resultsTotal);
 }