 | IFulltextQueryTDocumentHaving Method |
Filter the aggregated results of this query by the given predicate. Supported with Sphinx 2.2.1 and up.
Namespace: SphinxConnector.FluentApiAssembly: SphinxConnector (in SphinxConnector.dll) Version: 6.0.0
SyntaxIFulltextQuery<TDocument> Having(
Expression<Func<TDocument, bool>> predicate
)
Function Having (
predicate As Expression(Of Func(Of TDocument, Boolean))
) As IFulltextQuery(Of TDocument)
Parameters
- predicate ExpressionFuncTDocument, Boolean
Return Value
IFulltextQueryTDocumentThe current instance.
Exceptions
Example
using (IFulltextSession fulltextSession = fulltextStore.StartSession())
{
var results = fulltextSession.Query<Product>().
Match("a product").
GroupBy(p => p.VendorId).
Select(p => new
{
p,
Count = Projection.Count()
}).
Having(p => p.Count > 1).
ToList();
}
See Also