Faceted Search

For the most up-to-date documentation, please visit docs.brix.ch

Anura offers faceted search since version 2.6. In order for this to work, you'll need to add the anuraSolr-{version}.jar to {home}/appserver/lib and configure your SOLR server accordingly. Anura requires an extra index per referenced CELUM user, as permissions are not reflected in the search index, so we have to maintain a separate index per user that reflects what that user can see.

Compatibility Matrix

CELUM anura-solr
5.13.3 and below 1.4.x and below
5.13.4 - 6.0.x 1.5.x
6.1.x and above 1.6.x and above

Installation

  1. go to {home}/searchserver/solrhome
  2. copy the existing assets folder and call it assetsAnura{userId} (e.g. assetsAnura42 if your anura-user has the ID 42 - check anura.$i.userId)

    Make sure the directory is writable by the tomcat user, otherwise the indexing will fail later on

  3. CELUM 5.13.4 onwards or whenever the data directory is not inside the solrhome directory: Change the dataDir property in the copied assetsAnura{userId}/conf/solrconfig.xml to <dataDir>${solr.assetsAnura{userId}.data.dir:}</dataDir> (e.g. <dataDir>${solr.assetsAnura42.data.dir:}</dataDir>)

    Next, the file assetsAnura{userId}/core.properties must be adjusted as follows: name = assetsAnura{userId}

    Depending on the age of you conf/schema.xml, you may need to add docValues="true" to certain fields (observed with date and tdate on line 130+), otherwise you get a Can't facet on a Point Field without docValues

    <fieldType name="date" class="solr.DatePointField" positionIncrementGap="0" sortMissingLast="true" docValues="true"/>
    <fieldType name="tdate" class="solr.DatePointField" positionIncrementGap="0" sortMissingLast="true" docValues="true" />

    CELUM 5.13.3 and before: Add your new core to the solr.xml file (you can copy the assets line here as well)

    <cores adminPath="/admin/cores">
    <core name="assets" instanceDir="assets" />
    <core name="assetsAnura42" instanceDir="assetsAnura42" /> <!-- this -->
    <core name="containers" instanceDir="containers" />
    <core name="tasks" instanceDir="tasks" />
    <core name="processInstances" instanceDir="processInstances" />
    </cores>

    If you have customized the data directory of your asset core, e.g. by specifying -Dsolr.assets.data.dir=..., you'll need to change the dataDir property in the copied assetsAnura{userId}/conf/solrconfig.xml to something else, e.g. <dataDir>${solr.assetsAnura42.data.dir:}</dataDir> so you could pass -Dsolr.assetsAnura42.data.dir=... - otherwise it tries to write to the existing asset core data directory and fails.

  4. Restart the search server. In its web-UI, you should now see the new core in the "Core Selector" dropdown.
  5. Configure the facetProvider-property (e.g. anura.1.facetProvider=anuraSolrSearchRequestHandler) and restart the app server.
  6. In CELUM, go to Administration > System Tasks > Anura and start the Recreate facet search index task. Because there are no permission events in the SDK, you may also need to do that when you change the anura user's role(-assignments).
  7. You can now use facets: true in anuraSearch

Properties

To be configured in {home}/appserver/conf/custom.properties

anuraSolr.useSDKForFulltextSearch

type: boolean, required: no, default: false

Set this property to true, to use the SDK for fulltext search.

anuraSolr.facetLimit

type: boolean, required: no, default: -1

Set this property to another value 'x' to get only top 'x' facet result per faceted field. Not recommendet.

Troubleshooting

No results or all options gone

When you get either no results or all the faceted options get removed instantly after loading the page, check:

  • that the SOLR core was actually created successfully - see if it exists in the "Core Selector" on the left side of the SOLR UI. Observed mistakes include
    • Incorrect, missing or non-readable configuration files (check solr log)
    • Multiple cores using the same dataDir (see above)
    • the dataDir is not writable to the SOLR user
  • you have a current version of the conf/schema.xml and aren't missing any docValues (see above)
Textfield type-ahead suggestions are backwards

In your anura core's conf/schema.xml, remove the following line:

 <filter class="solr.ReversedWildcardFilterFactory"/>

... and recreate the search index.

Release notes

1.0.0
  • Initial release
1.1.3
  • Improved error handling
1.1.9
  • Improved indexing