Esempio n. 1
0
        /// <summary>
        /// Selects the specified fields directly from the index
        /// </summary>
        /// <typeparam name="TProjection">The type of the projection.</typeparam>
        public virtual IAsyncDocumentQuery <TProjection> SelectFields <TProjection>(string[] fields, string[] projections)
        {
            var asyncDocumentQuery = new AsyncDocumentQuery <TProjection>(theSession,
                                                                          indexName, fields, projections,
                                                                          isMapReduce)
            {
                pageSize   = pageSize,
                queryText  = new StringBuilder(queryText.ToString()),
                start      = start,
                timeout    = timeout,
                cutoffEtag = cutoffEtag,
                queryStats = queryStats,
                theWaitForNonStaleResults        = theWaitForNonStaleResults,
                theWaitForNonStaleResultsAsOfNow = theWaitForNonStaleResultsAsOfNow,
                orderByFields          = orderByFields,
                dynamicMapReduceFields = dynamicMapReduceFields,
                isDistinct             = isDistinct,
                allowMultipleIndexEntriesForSameDocumentToResultTransformer = allowMultipleIndexEntriesForSameDocumentToResultTransformer,
                negate = negate,
                transformResultsFunc        = transformResultsFunc,
                includes                    = new HashSet <string>(includes),
                isSpatialQuery              = isSpatialQuery,
                spatialFieldName            = spatialFieldName,
                queryShape                  = queryShape,
                spatialRelation             = spatialRelation,
                spatialUnits                = spatialUnits,
                distanceErrorPct            = distanceErrorPct,
                rootTypes                   = { typeof(T) },
                defaultField                = defaultField,
                beforeQueryExecutionAction  = beforeQueryExecutionAction,
                afterQueryExecutedCallback  = afterQueryExecutedCallback,
                afterStreamExecutedCallback = afterStreamExecutedCallback,
                highlightedFields           = new List <HighlightedField>(highlightedFields),
                highlighterPreTags          = highlighterPreTags,
                highlighterPostTags         = highlighterPostTags,
                resultsTransformer          = resultsTransformer,
                transformerParameters       = transformerParameters,
                disableEntitiesTracking     = disableEntitiesTracking,
                disableCaching              = disableCaching,
                showQueryTimings            = showQueryTimings,
                lastEquality                = lastEquality,
                shouldExplainScores         = shouldExplainScores
            };

            asyncDocumentQuery.AfterQueryExecuted(afterQueryExecutedCallback);
            return(asyncDocumentQuery);
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AbstractDocumentQuery{T,TSelf}"/> class.
 /// </summary>
 public AsyncDocumentQuery(AsyncDocumentQuery <T> other)
     : base(other)
 {
 }