Exclude scopes to search in

Next to including scopes to search in, you can also exclude scopes to search in. For example, if you want to search in your current channel only, but exclude news and agenda folder, you can achieve this through:

HippoSolrClient solrClient =
      HstServices.getComponentManager().getComponent(
                    HippoSolrClient.class.getName(), "org.hippoecm.hst.solr");
HippoQuery hippoQuery = solrClient.createQuery(query);
String scope = request.getRequestContext().getResolvedMount().
                               getMount().getCanonicalContentPath();
hippoQuery.setScopes(scope);
hippoQuery.setExcludedScopes(scope+"/news", scope+"/agenda");
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