Use the OpenCms API for Solr Search

 

This Demo shows, how to use the OpenCms Java Core API to search for content with Apache Solr.

 

In the center container of this page you see a function element using the solr-api-demo.jsp that compares retrieving content in the classic style with retrieving content with the search API of OpenCms.

 

Parallely it explains how to use the new search field mapping that can be declared inside a the Content Defnition (XSD) file of an XML Content. For activating a "pre definied field mapping", switch to the Root-Site within the OpenCms Workplace Explorer and edit the XSD for the resource type ddarticle (Dev-Demo-Article). There you will find inside the app info node a out commented section declaring a field mapping. Remove those comments.

 

Once you there exist a new field mapping touch and rewrite all the resources of the type ddarticle in order to trigger a reindexing for those articles beeing sure all the extraction result caches are cleared and the field mapping is performed. Having done these steps reload this page and look at the result. Have fun using Solr integrated into OpenCms 8!!!

 

Classic way



Total time used for querying and rendering the whole page: 263 ms