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.
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 (+) | - | - |
If you are in their "pipeline hosting", follow this guide instead! In short, edit their
customer-properties.yaml
and addsolr: customCores: - assetsAnura1
go to {home}/searchserver/solrhome
download the solr core template and extract it
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
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.
Restart the search server. In its web-UI, you should now see the new core in the "Core Selector" dropdown.
Configure the facetProvider-property (e.g. anura.1.facetProvider=anuraSolrSearchRequestHandler
) and restart the app server.
BREAKING CHANGE as of 6.17: You need to whitelist the SOLR URL: sdk.property.whitelist=search.serverUrl
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).
You can now use facets: true
in anuraSearch
To be configured in {home}/appserver/conf/custom.properties
type: String, required: yes, default: ${search.serverUrl}
The URL of the SOLR server. Defaults to the one CELUM is using.
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}
type: boolean, required: no, default: true
Set this property to true, to use the SDK for fulltext search.
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.
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 ^^
type: String , required: no, default: -
A cron expression (quartz) to run the recreation task automatically, e.g. 0 0 0 * * ?
for midnight.
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.
type: int , required: no, default: 10
Size of the threadpool to run the re-indexing with.
type: int , required: no, default: 200
The fetch-size used then re-indexing.
When you get either no results or all the faceted options get removed instantly after loading the page, check:
dataDir
(see above)dataDir
is not writable to the SOLR userdocValues
(see above)*:*
and hit Execute Query. Response should return a numFound
> 0. If not, check the Anura: recreate facets tasks (or the log) for error messages.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.In your anura core's conf/schema.xml, remove the following line:
<filter class="solr.ReversedWildcardFilterFactory"/>
... and recreate the search index.
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.