Esempio n. 1
0
        public async Task <FacetedQueryResult> ExecuteFacetedQuery(IndexQueryServerSide query, long?existingResultEtag, DocumentsOperationContext documentsContext, OperationCancelToken token)
        {
            if (query.Metadata.IsDynamic)
            {
                throw new InvalidQueryException("Facet query must be executed against static index.", query.Metadata.QueryText, query.QueryParameters);
            }

            ObjectDisposedException lastException = null;

            for (var i = 0; i < NumberOfRetries; i++)
            {
                try
                {
                    documentsContext.CloseTransaction();
                    var sw = Stopwatch.StartNew();

                    var result = await _static.ExecuteFacetedQuery(query, existingResultEtag, documentsContext, token);

                    result.DurationInMs = (long)sw.Elapsed.TotalMilliseconds;

                    return(result);
                }
                catch (ObjectDisposedException e)
                {
                    if (Database.DatabaseShutdown.IsCancellationRequested)
                    {
                        throw;
                    }

                    lastException = e;
                }
            }

            throw CreateRetriesFailedException(lastException);
        }
Esempio n. 2
0
        public Task <FacetedQueryResult> ExecuteFacetedQuery(FacetQueryServerSide query, long?facetsEtag, long?existingResultEtag, DocumentsOperationContext documentsContext, OperationCancelToken token)
        {
            if (query.Metadata.IsDynamic)
            {
                throw new InvalidQueryException("Facet query must be executed against static index.", query.Metadata.QueryText, query.QueryParameters);
            }

            return(_static.ExecuteFacetedQuery(query, facetsEtag, existingResultEtag, documentsContext, token));
        }
Esempio n. 3
0
        public async Task <FacetedQueryResult> ExecuteFacetedQuery(IndexQueryServerSide query, long?existingResultEtag, DocumentsOperationContext documentsContext, OperationCancelToken token)
        {
            if (query.Metadata.IsDynamic)
            {
                throw new InvalidQueryException("Facet query must be executed against static index.", query.Metadata.QueryText, query.QueryParameters);
            }

            var sw = Stopwatch.StartNew();

            var result = await _static.ExecuteFacetedQuery(query, existingResultEtag, documentsContext, token);

            result.DurationInMs = (long)sw.Elapsed.TotalMilliseconds;

            return(result);
        }