Add Advanced Search to a Project
Adding Advanced Search to a Project
Set up a Bloomreach Experience Manager project.
Add the following dependencies to cms/pom.xml in your project:
<dependency> <groupId>com.onehippo.cms7</groupId> <artifactId>hippo-addon-advanced-search-frontend</artifactId> <type>pom</type> </dependency> <dependency> <groupId>com.onehippo.cms7</groupId> <artifactId>hippo-addon-advanced-search-repository</artifactId> </dependency>
Rebuild your project.
Configure the Document Types Filter Dropdown
Configure which document types can be selected in the filter section of the search perspective:
/hippo:configuration/hippo:frontend/cms/cms-advanced-search/genericFilters: document.type.namespaces: [ 'myhippoproject' ] document.type.excluded: [ 'myhippoproject:basedocument' ]
The above example includes all document types in the myhippoproject namespace, except myhippoproject:basedocument.
Note that when no document types are selected in the filter, the search results will include all document types regardless of the above configuration.
Configure Inclusion of Subtypes
By default, search results do not include subtypes of the document types selected in the search filter:
/hippo:configuration/hippo:frontend/cms/cms-advanced-search/genericFilters: document.subtypes.included: false
Set the document.subtypes.included property to true to include subtypes of selected document types in search results.
Configure Wildcard Postfixing
By default, Advanced Search applies wildcard postfixing to search terms of 3 characters or longer. This means that the search results will include documents that contain words starting with the search term. This behavior can be fine-tuned or completely disabled by configuring the Search Service used by Advanced Search to execute queries.