Faceted Search

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

AnuraSolr Anura CELUM 6 CELUM 5.13.x CELUM 5.12.x
1.0 - 1.4 2.5 - 2.6.13 5.13.0 - 5.13.3 5.12.3 (+)
1.0 - 1.4 2.6.14 - 2.7.6 5.13.3
1.5 2.7.9 and above 5.13.4 (+)
1.6 2.8.0 and above 6.1 (+) - -
1.6.1 and above 2.8.1 and above 6.4 (+) - -
1.7 and above 2.9 6.8 (+) - -

Installation

If you are in their "pipeline hosting", follow this guide instead! In short, edit their customer-properties.yaml and add

solr:
customCores:
- assetsAnura1
  1. go to {home}/searchserver/solrhome

  2. download the solr core template and extract it

  3. rename it assetsAnura{userId} (e.g. assetsAnura42 if your anura-user has the ID 42 - check anura.$i.userId).

    The file assetsAnura{userId}/core.properties must be also adjusted as follows: name = assetsAnura{userId}

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

  4. 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>)

    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.

  5. Restart the search server. In its web-UI, you should now see the new core in the "Core Selector" dropdown. solr-core

  6. Configure the facetProvider-property (e.g. anura.1.facetProvider=anuraSolrSearchRequestHandler) and restart the app server.

  7. BREAKING CHANGE as of 6.17: You need to whitelist the SOLR URL: sdk.property.whitelist=search.serverUrl

  8. 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).

  9. You can now use facets: true in anuraSearch

Properties

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

anuraSolr.solrUrl

type: String, required: yes, default: ${search.serverUrl}

The URL of the SOLR server. Defaults to the one CELUM is using.

anuraSolr.leadingWildcardSearch

type: boolean, required: yes, default: ${search.enableLeadingWildcardSearch}

Whether to use leading wildcard search. This must match the settings you use in CELUM, so the default is ${search.enableLeadingWildcardSearch}

anuraSolr.useSDKForFulltextSearch

type: boolean, required: no, default: true

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.

anuraSolr.translateFilterToSolr

type: boolean, required: no, default: false, status: beta

When using globalFilter, translate the filter into a SOLR native query instead of using the SDK. This is a lot faster, but not every query is supported yet. Known supported queries: and, or, asset type, checkbox, dropdown, node assignments. Contact us if you need more ^^

anuraSolr.cronExpression

type: String , required: no, default: -

A cron expression (quartz) to run the recreation task automatically, e.g. 0 0 0 * * ? for midnight.

anuraSolr.cronExpressionCleanUpEntries

type: String, required: no, default: 0 0 0 ?, since: 1.7

A cron expression (quartz) to run the cleanup task, i.e. remove expired assets from the index.

anuraSolr.threadPoolSize

type: int , required: no, default: 10

Size of the threadpool to run the re-indexing with.

anuraSolr.reindexPageSize

type: int , required: no, default: 200

The fetch-size used then re-indexing.

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)
  • if the core (assetsAnura123) has any assets in it. Go to Query, set q to *:* and hit Execute Query. Response should return a numFound > 0. If not, check the Anura: recreate facets tasks (or the log) for error messages.
  • if only some fields seem to be missing in the facet response it's probably a permission issue. To see if any values are indexed for a particular field, e.g. NodeRef 360, query for nodeBackedPathIds_360:* and see if you get any results (depending on the field type the key will be different, e.g. customFields_<type>_<id>. If the query yields no results, double-check the users permissions and re-index.
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.

unknown field 'path'

Since 6.14 a yet unknown change has been made to the schema.xml's path field. Until a better fix is available, add

<field name="path" type="string" indexed="true" multiValued="true" stored="true" omitNorms="true"/>

below the field "containers" in your copied schema.xml.

Release notes

1.0.0
  • Initial release
1.1.3
  • Improved error handling
1.1.9
  • Improved indexing
1.2
  • Added nodereference and/or logic
1.3
  • Improved indexing performance
1.4
  • Extra version for older CELUM with solr 4
  • Added CELUM-Filter translation
1.5
  • Implemented a cleanup task to remove assets from the index, that no longer exist, but have been missed to be deleted
1.6
  • Added support for the new filters
1.7
  • Bump minimal CELUM version to 6.8
  • Support new text search behavior
1.8
  • new approach for full-text search (performance)