Upon installation of the search-provider-elasticsearch module, a configuration file named org.jahia.modules.augmentedsearch.cfg
is created under digital-factory-data/karaf/etc/ . This configuration file is used to specify the types of contents that need to be indexed in Elasticsearch.
Please note that whenever you modify this file in a Jahia cluster environment, the synchronization does not happen automatically, so you have to copy the modified file to each cluster node.
The indexing and the way to return results with Elasticsearch are done differently from the default JCR search provider. The JCR search provider indexes each content individually, then an aggregation is performed when collecting the search results. On the other side, the Elasticsearch search provider already aggregates in the index contents which are displayable in full page: pages (jnt:page) and contents which come with a content template (e.g. jnt:news). By default, only pages are indexed.
org.jahia.modules.augmentedsearch.content.indexedMainResourceTypes
defines the list of content types that can be indexed as full page contents. These content types need to have corresponding content templates in order to be displayed individually, like "pages". Only content templates without restriction (mode / user / permissions), which are set in the studio, can be used to index content.
To index content in your site, you must declare nodes hierarchically. You must always declare jnt:page
first and then other nodes in the hierarchy. You declare nodes by adding them under org.jahia.modules.augmentedsearch.content.indexedMainResourceTypes
, as shown in following example.
org.jahia.modules.augmentedsearch.content.indexedMainResourceTypes = \ jnt:page, \ jnt:news
File changes are reloaded automatically and you do not need to restart Jahia.
Only fulltext and metadata are indexed by default. If you want to do a search on a specific property you have to list it in:
org.jahia.modules.augmentedsearch.content.mappedNodeTypes
By default, only the contents which have the jmix:editorialContent as supertype are indexed as subnodes of main resource (pages or contents with a content template).
Other content types can be indexed by listing them in:
org.jahia.modules.augmentedsearch.content.indexedSubNodeTypes