Click or drag to resize
IFulltextQueryTDocumentHaving Method
Filter the aggregated results of this query by the given predicate. Supported with Sphinx 2.2.1 and up.

Namespace: SphinxConnector.FluentApi
Assembly: SphinxConnector (in SphinxConnector.dll) Version: 3.12.6
Syntax
IFulltextQuery<TDocument> Having(
	Expression<Func<TDocument, bool>> predicate
)

Parameters

predicate
Type: System.Linq.ExpressionsExpressionFuncTDocument, Boolean

Return Value

Type: IFulltextQueryTDocument
The current instance.
Exceptions
ExceptionCondition
ArgumentNullExceptionOccurs when predicate is null.
InvalidOperationExceptionOccurs when this method called more than once for query.
Examples
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