Testsuite example with Hippo CMS and Solr - 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.

Testsuite example with Hippo CMS and Solr

Download or clone the latest Test Suite tag from https://code.onehippo.org/cms-community/hippo-testsuite.

Install and start it with

mvn clean install && mvn -P cargo.run

You will have a /solr webapp available at

http://localhost:8080/solr/admin

When you visit

http://localhost:8080/site

you see the menu items

  1. Solr Search : This contains an overview of many features, like

    1. suggestions

    2. highlighting

    3. did you mean

    4. search in scope

    5. search only for certain bean types

    6. order by some criteria

    7. search in certain fields only

    8. date ranges

  2. Solr Faceted : This contains a faceted example combining free text search using Solr, and at the same time show the pretty facet/value kind of URLs
  3. Solr Indexer : Showing all JCR documents and buttons to index them into Solr.
  4. GoGreen Solr Indexer : Through this page, you can index some external GOGREEN product sources. There is a pre-filled URL http://www.demo.onehippo.com/restapi/products/food/2011/11./documents?_type=xml. If you submit that URL, the documents from that REST url will be crawled, and indexed into Solr. You can then search for those documents (eg peppered taters) and will get search results with links pointing to the correct GoGreen website pages

To enable the suggestions the Testsuite example has added an extra SpellCheckComponent to the solrconfig.xml. It looks as follows:

 <!-- **************************** START SUGGEST *****************-->
  <!-- ONLY INCLUDE THE SUGGEST COMPONENT WHEN ACTUALLY USED
       BECAUSE IT USES QUITE SOME MEMORY -->
  <searchComponent class="solr.SpellCheckComponent" name="suggest">
    <lst name="spellchecker">
      <str name="name">suggest</str>
      <!-- the indexed field to derive suggestions from -->
      <str name="field">text</str>
      <str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
      <str name="lookupImpl">org.apache.solr.spelling.suggest.tst.TSTLookup
      </str>
      <!-- Alternatives to lookupImpl:
           org.apache.solr.spelling.suggest.fst.FSTLookup
               [finite state automaton]
           org.apache.solr.spelling.suggest.fst.WFSTLookupFactory
               [weighted finite state automaton]
           org.apache.solr.spelling.suggest.jaspell.JaspellLookup
               [default, jaspell-based]
           org.apache.solr.spelling.suggest.tst.TSTLookup
               [ternary trees]
      -->
      <!--float name="threshold">0.005</float-->
      <str name="buildOnCommit">true</str>
    </lst>

  </searchComponent>


  <requestHandler name="suggest"
                  class="org.apache.solr.handler.component.SearchHandler" >
    <lst name="defaults">
      <str name="spellcheck">true</str>
      <str name="spellcheck.dictionary">suggest</str>
      <str name="spellcheck.onlyMorePopular">true</str>
      <str name="spellcheck.count">100</str>
      <str name="spellcheck.collate">true</str>
    </lst>
    <arr name="components">
      <str>suggest</str>
    </arr>
  </requestHandler>


  <!-- **************************** END SUGGEST *********************-->
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?