IFulltext QueryTDocumentHaving Method
Filter the aggregated results of this query by the given predicate. Supported with Sphinx 2.2.1 and up.
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<TDocument> Having(
Expression<Func<TDocument, bool>> predicate
)VB
Function Having (
predicate As Expression(Of Func(Of TDocument, Boolean))
) As IFulltextQuery(Of TDocument)Parameters
- predicate ExpressionFuncTDocument, Boolean
Return Value
IFulltextQueryTDocumentThe current instance.
Example
C#
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();
}Exceptions
| ArgumentNullException | Occurs when predicate is null. |
| InvalidOperationException | Occurs when this method called more than once for query. |