项目作者: TYPO3-Solr

项目描述 :
An Apache Solr filter plugin to support TYPO3 access restrictions.
高级语言: Java
项目地址: git://github.com/TYPO3-Solr/solr-typo3-plugin.git
创建时间: 2015-03-13T17:14:40Z
项目社区:https://github.com/TYPO3-Solr/solr-typo3-plugin

开源协议:Apache License 2.0

下载


GitHub Build Status

Solr TYPO3 Plugin

The Solr TYPO3 plugin provides the AccessFilterQParserPlugin, which is a
org.apache.solr.search.QParserPlugin that allows to restrict access to Solr
documents indexed by TYPO3 on a document level.

It filters the documents returned from a query by performing set operations
between a particular string field in the index and the specified value. These
values are comma separated lists of user group IDs, the index field stores the
groups that are allowed to access a particular document while the groups the
user is a member of / has access to are specified through a filter parameter.

Example

  1. http://localhost:8983/path/to/solr/select/?fq={!typo3access field=fieldname}permittedUserGroups&q=...
  2. http://localhost:8983/solr/collection1/select/?q=title:Hello&fq={!typo3access}0,1,4,10
  • The field parameter is optional and defaults to “access”, it is the name of the string field holding the access restrictions for a document
  • permittedUserGroups is a comma separated list of groups the user is granted access to

Adding the plugin to Solr

To use this plugin, simply copy the jar file containing the plugin classes into your
$SOLR_HOME/lib directory and then add the following to your solrconfig.xml file:

  1. <queryParser name="typo3access" class="org.typo3.solr.search.AccessFilterQParserPlugin" ></queryParser>

In your schema.xml add a field like this:

  1. <field name="access" type="string" indexed="false" stored="true" docValues="true" default="c:0" ></field>

It is important to turn on DocValues. The field does not need to be stored,
but it helps with debugging.

Finally, restart your servlet container.