Click or drag to resize

IFulltextQueryTDocumentWithSubqueryTSubqueryResult Method

Defines a subquery from which the results for this query are selected.

Namespace:  SphinxConnector.FluentApi
Assembly:  SphinxConnector (in SphinxConnector.dll) Version: 5.3.0
Syntax
IFulltextQuery<TSubqueryResult> WithSubquery<TSubqueryResult>(
	Expression<Func<IFulltextQuery<TDocument>, IFulltextQuery<TSubqueryResult>>> expression
)

Parameters

expression
Type: System.Linq.ExpressionsExpressionFuncIFulltextQueryTDocument, IFulltextQueryTSubqueryResult
The subquery expression.

Type Parameters

TSubqueryResult
The result type returned by the subquery.

Return Value

Type: IFulltextQueryTSubqueryResult
The current instance.
Examples
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