Add Advanced Search to a Project
Adding Advanced Search to a project
Add the following dependencies to your CMS module:
<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 to be selected
Configure the document types that 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.
Configure if subtypes of document types need to be selected
By default, Advanced Search does 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.