Пример #1
0
        public virtual Task <FacetedQueryResult> GetFacetsAsync(List <Facet> facets, int start, int?pageSize, CancellationToken token = default(CancellationToken))
        {
            var q     = GetIndexQuery();
            var query = FacetQuery.Create(indexName, q, null, facets, start, pageSize);

            return(asyncDatabaseCommands.GetFacetsAsync(query, token));
        }
Пример #2
0
        public virtual FacetedQueryResult GetFacets(List <Facet> facets, int start, int?pageSize)
        {
            var q     = GetIndexQuery(false);
            var query = FacetQuery.Create(indexName, q, null, facets, start, pageSize);

            return(databaseCommands.GetFacets(query));
        }
Пример #3
0
        /// <inheritdoc />
        public Lazy <FacetedQueryResult> GetFacetsLazy(List <Facet> facets, int facetStart, int?facetPageSize)
        {
            var q     = GetIndexQuery();
            var query = FacetQuery.Create(q, null, facets, facetStart, facetPageSize, Conventions);

            var lazyFacetsOperation = new LazyFacetsOperation(Conventions, query);

            return(((DocumentSession)TheSession).AddLazyOperation(lazyFacetsOperation, (Action <FacetedQueryResult>)null));
        }
Пример #4
0
        public virtual FacetedQueryResult GetFacets(List <Facet> facets, int start, int?pageSize)
        {
            var q       = GetIndexQuery(false);
            var query   = FacetQuery.Create(q, null, facets, start, pageSize, Session.Conventions);
            var command = new GetFacetsCommand(_session.Conventions, _session.Context, query);

            _session.RequestExecutor.Execute(command, _session.Context);
            return(command.Result);
        }
Пример #5
0
        public virtual Task <FacetedQueryResult> GetFacetsAsync(string facetSetupDoc, int start, int?pageSize, CancellationToken token = default(CancellationToken))
        {
            var q     = GetIndexQuery();
            var query = FacetQuery.Create(indexName, q, facetSetupDoc, null, start, pageSize);

            // TODO iftah
            return(null);
            //return asyncDatabaseCommands.GetFacetsAsync(query, token);
        }
Пример #6
0
        public virtual FacetedQueryResult GetFacets(string facetSetupDoc, int start, int?pageSize)
        {
            var q     = GetIndexQuery(false);
            var query = FacetQuery.Create(indexName, q, facetSetupDoc, null, start, pageSize);

            // TODO iftah
            return(null);
            //return databaseCommands.GetFacets(query);
        }
Пример #7
0
        /// <inheritdoc />
        public Lazy <Task <FacetedQueryResult> > GetFacetsLazyAsync(List <Facet> facets, int facetStart, int?facetPageSize, CancellationToken token = default(CancellationToken))
        {
            var q     = GetIndexQuery();
            var query = FacetQuery.Create(q, null, facets, facetStart, facetPageSize, Conventions);

            var lazyFacetsOperation = new LazyFacetsOperation(Conventions, query);

            return(((AsyncDocumentSession)TheSession).AddLazyOperation <FacetedQueryResult>(lazyFacetsOperation, null, token));
        }
Пример #8
0
        public virtual async Task <FacetedQueryResult> GetFacetsAsync(List <Facet> facets, int start, int?pageSize, CancellationToken token = default(CancellationToken))
        {
            var q     = GetIndexQuery();
            var query = FacetQuery.Create(q, null, facets, start, pageSize, Session.Conventions);

            var command = new GetFacetsCommand(_session.Conventions, _session.Context, query);
            await _session.RequestExecutor.ExecuteAsync(command, _session.Context, token).ConfigureAwait(false);

            return(command.Result);
        }
Пример #9
0
        /// <inheritdoc />
        public async Task <FacetedQueryResult> GetFacetsAsync(string facetSetupDoc, int facetStart, int?facetPageSize, CancellationToken token = default(CancellationToken))
        {
            var q     = GetIndexQuery();
            var query = FacetQuery.Create(q, facetSetupDoc, null, facetStart, facetPageSize, Conventions);

            var command = new GetFacetsCommand(Conventions, TheSession.Context, query);
            await TheSession.RequestExecutor.ExecuteAsync(command, TheSession.Context, token).ConfigureAwait(false);

            return(command.Result);
        }
Пример #10
0
        /// <inheritdoc />
        public FacetedQueryResult GetFacets(List <Facet> facets, int facetStart, int?facetPageSize)
        {
            var q     = GetIndexQuery();
            var query = FacetQuery.Create(q, null, facets, facetStart, facetPageSize, Conventions);

            var command = new GetFacetsCommand(Conventions, TheSession.Context, query);

            TheSession.RequestExecutor.Execute(command, TheSession.Context);

            return(command.Result);
        }
Пример #11
0
        public override async Task <FacetedQueryResult> GetFacetsAsync(string facetSetupDoc, int start, int?pageSize, CancellationToken token = default(CancellationToken))
        {
            var indexQuery = GetIndexQuery(true);
            var results    = await shardStrategy.ShardAccessStrategy.ApplyAsync(asyncShardDbCommands, new ShardRequestData
            {
                IndexName  = AsyncIndexQueried,
                EntityType = typeof(T),
                Query      = indexQuery
            }, (commands, i) =>
            {
                var query = FacetQuery.Create(AsyncIndexQueried, indexQuery, facetSetupDoc, null, start, pageSize);
                return(commands.GetFacetsAsync(query, token));
            }).ConfigureAwait(false);

            return(MergeFacets(results));
        }
Пример #12
0
        public override FacetedQueryResult GetFacets(List <Facet> facets, int start, int?pageSize)
        {
            var indexQuery = GetIndexQuery(false);
            var results    = shardStrategy.ShardAccessStrategy.Apply(shardDbCommands, new ShardRequestData
            {
                IndexName  = IndexQueried,
                EntityType = typeof(T),
                Query      = indexQuery
            }, (commands, i) =>
            {
                var query = FacetQuery.Create(IndexQueried, indexQuery, null, facets, start, pageSize);
                return(commands.GetFacets(query));
            });

            return(MergeFacets(results));
        }