HST Solr Content Beans - BloomReach Experience - Open Source CMS

This article covers a Hippo CMS version 11. There's an updated version available that covers our most recent release.

04-07-2016

HST Solr Content Beans

The hst-solr-content-beans module contains the interfaces through which to bootstrap a HippoQuery (which is a lightweight wrapper class around org.apache.solr.client.solrj.SolrQuery) to execute the query as a HippoQueryResult, and to be able to iterate through the search hits : The IdentifiableContentBean's.

The HippoQueryResult by default populates search hits to IdentifiableContentBean without using their original content providers (eg JCR Document, external http sources or other CMS's or DMS's): This means by default only the fields that were stored in the Solr index and have a setter method for the field are populated in the IdentifiableContentBean. Thus, only those fields that:

  1. Have a setter method with an @IndexField annotated getter

  2. Have their field stored in the Solr (Lucene) index : This can be configured in the Solr schema.xml

are available by default in the POJOs returned by the HippoQueryResult.

Fields in compound (beans in beans) parts will not be re-populated even if the compound is indexed and has its value stored in the index!

If the backing providers for different IdendifiableContentBeans need to be attached to re-populate the beans, you need to call one of these:

HippoSolrClient query bootstrapping:

//  Uses all default available providers to bind the results
HippoQueryResult.setContentBeanBinders()
//  Uses the binders in the argument to bind the results
HippoQueryResult.setContentBeanBinders(List<ContentBeanBinder> binders)

For optimal blistering fast performance, you can try to skip HippoQueryResult.setContentBeanBinders in case you can provide the pages with only fields stored in Solr. This way you can avoid round trips for fetching the backing provider of some IdentifiableContentBean.

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?