IFulltext QueryTDocumentWith SubqueryTSubqueryResult Method
Defines a subquery from which the results for this query are selected.
Definition
Namespace: SphinxConnector.FluentApi
Assembly: SphinxConnector (in SphinxConnector.dll) Version: 6.1.0
The current instance.
Assembly: SphinxConnector (in SphinxConnector.dll) Version: 6.1.0
C#
IFulltextQuery<TSubqueryResult> WithSubquery<TSubqueryResult>(
Expression<Func<IFulltextQuery<TDocument>, IFulltextQuery<TSubqueryResult>>> expression
)
VB
Function WithSubquery(Of TSubqueryResult) (
expression As Expression(Of Func(Of IFulltextQuery(Of TDocument), IFulltextQuery(Of TSubqueryResult)))
) As IFulltextQuery(Of TSubqueryResult)Parameters
- expression ExpressionFuncIFulltextQueryTDocument, IFulltextQueryTSubqueryResult
- The subquery expression.
Type Parameters
- TSubqueryResult
- The result type returned by the subquery.
Return Value
IFulltextQueryTSubqueryResultThe current instance.
Example
C#
using (IFulltextSession fulltextSession = fulltextStore.StartSession())
{
var results = fulltextSession.Query<Product>().
WithSubquery(subquery => subquery.Match("a product").
Take(10000)).
OrderBy(p => p.Price).
Take(50000).
ToList();
}