コード例 #1
0
        public IIndexConfig CreateIndex(IIndexSelector selector)
        {
            var index = Factories.Index.Create(this, selector);

            index = this.Indexes.AddOrUpdate(index.Identifier, index);
            return(index);
        }
コード例 #2
0
        public IIndexConfig GetIndex(IIndexSelector selector)
        {
            var existing = default(IIndexConfig);
            var index    = Factories.Index.Create(this, selector);

            if (!this.Indexes.TryGetValue(index.Identifier, out existing) || !IndexComparer.IndexConfig.Equals(index, existing))
            {
                return(default(IIndexConfig));
            }
            return(existing);
        }
コード例 #3
0
 public ElasticSearchWrapper(IElasticClient esClient, IQueryFactory queryFactory,
                             IPagingHelper pagingHelper, ISortFactory sortFactory, ILogger <ElasticSearchWrapper> logger, IIndexSelector indexSelector,
                             IFilterFactory filterFactory)
 {
     _esClient      = esClient;
     _queryFactory  = queryFactory;
     _pagingHelper  = pagingHelper;
     _sortFactory   = sortFactory;
     _filterFactory = filterFactory;
     _logger        = logger;
     _indexSelector = indexSelector;
 }
コード例 #4
0
        public IIndexConfig Create(ITableConfig table, IIndexSelector selector)
        {
            switch (selector.SelectorType)
            {
            case IndexSelectorType.Columns:
                return(this.Create(table, selector.Identifier, selector.Columns, selector.Flags));

            case IndexSelectorType.ColumnNames:
                return(this.Create(table, selector.Identifier, selector.ColumnNames, selector.Flags));

            default:
                throw new NotImplementedException();
            }
        }