IFulltextQueryTDocumentWithSubqueryTSubqueryResult 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
C#
IFulltextQuery<TSubqueryResult> WithSubquery<TSubqueryResult>(
	Expression<Func<IFulltextQuery<TDocument>, IFulltextQuery<TSubqueryResult>>> expression
)

Parameters

expression  ExpressionFuncIFulltextQueryTDocument, IFulltextQueryTSubqueryResult
The subquery expression.

Type Parameters

TSubqueryResult
The result type returned by the subquery.

Return Value

IFulltextQueryTSubqueryResult
The 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();
}

See Also