This article covers a Bloomreach Experience Manager version 11. There's an updated version available that covers our most recent release.

20-03-2017

Negate a Query Constraint

If you have a query with one or more constraints, you can negate() any of those constraints:

// Query documents that do not contain "hippo"
final HstQuery query = HstQueryBuilder.create(scope)
        .ofTypes(BaseDocument.class)
        .limit(10)
        .where(constraint(".").contains("hippo").negate())
        .build();
Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?

    We rely on cookies

    to optimize our communication and to enhance your customer experience. By clicking on the Accept and Close button, you agree to the collection of cookies. You can also adjust your preferences by clicking on Manage Preferences. For more information please see our Privacy policy.

    Manage cookies
    Accept & close

    Cookies preferences

    Accept & close
    Back