You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2015/03/10 11:48:27 UTC

svn commit: r1665464 - /manifoldcf/integration/solr-5.x/trunk/README.txt

Author: kwright
Date: Tue Mar 10 10:48:27 2015
New Revision: 1665464

URL: http://svn.apache.org/r1665464
Log:
Update README to include 5.x material

Modified:
    manifoldcf/integration/solr-5.x/trunk/README.txt

Modified: manifoldcf/integration/solr-5.x/trunk/README.txt
URL: http://svn.apache.org/viewvc/manifoldcf/integration/solr-5.x/trunk/README.txt?rev=1665464&r1=1665463&r2=1665464&view=diff
==============================================================================
--- manifoldcf/integration/solr-5.x/trunk/README.txt (original)
+++ manifoldcf/integration/solr-5.x/trunk/README.txt Tue Mar 10 10:48:27 2015
@@ -53,30 +53,67 @@ a Query Parser plugin.  The second is us
 the first step is to have ManifoldCF installed and running.  See:
 http://manifoldcf.apache.org/release/trunk/en_US/how-to-build-and-deploy.html
 
-Then, you will need to add fields to your Solr schema.xml file that can be used
-to contain document authorization information.  There will need to be six of these
-fields, an 'allow' field for documents, parents, and shares, and a 'deny' field for
-documents, parents, and shares.  For example:
-
-  <field name="allow_token_document" type="string" indexed="true" stored="false"
-    multiValued="true" required="false" default="__nosecurity__"/>
-  <field name="allow_token_parent" type="string" indexed="true" stored="false"
-    multiValued="true" required="false" default="__nosecurity__"/>
-  <field name="allow_token_share" type="string" indexed="true" stored="false"
-    multiValued="true" required="false" default="__nosecurity__"/>
-  <field name="deny_token_document" type="string" indexed="true" stored="false"
-    multiValued="true" required="false" default="__nosecurity__"/>
-  <field name="deny_token_parent" type="string" indexed="true" stored="false"
-    multiValued="true" required="false" default="__nosecurity__"/>
-  <field name="deny_token_share" type="string" indexed="true" stored="false"
-    multiValued="true" required="false" default="__nosecurity__"/>
+Then, in order to store the document authorization information you need to add
+'allow' and 'deny' fields for documents, parents, and shares to your Solr
+index. Depending on your schemaFactory setting in solrconfig.xml you have to 
+use either the schema.xml file for 'ClassicIndexSchemaFactory' or the schema
+API for 'ManagedIndexSchemaFactory'. 
+See section 'Managed Schema Definition in SolrConfig' in the Solr Reference Gude
+https://www.apache.org/dyn/closer.cgi/lucene/solr/ref-guide/apache-solr-ref-guide-5.0.pdf
+
+For schema.xml simply add the following field definitions to the <schema>
+section:
+
+  <field name="allow_token_document" type="string" indexed="true" stored="true"
+    multiValued="true" required="true" default="__nosecurity__"/>
+  <field name="allow_token_parent" type="string" indexed="true" stored="true"
+    multiValued="true" required="true" default="__nosecurity__"/>
+  <field name="allow_token_share" type="string" indexed="true" stored="true"
+    multiValued="true" required="true" default="__nosecurity__"/>
+  <field name="deny_token_document" type="string" indexed="true" stored="true"
+    multiValued="true" required="true" default="__nosecurity__"/>
+  <field name="deny_token_parent" type="string" indexed="true" stored="true"
+    multiValued="true" required="true" default="__nosecurity__"/>
+  <field name="deny_token_share" type="string" indexed="true" stored="true"
+    multiValued="true" required="true" default="__nosecurity__"/>
+
+To define the fields via schema API use the curl command instead:
+
+curl -X POST -H 'Content-type:application/json' --data-binary '{ 
+  "add-field" : [
+  { "name":"allow_token_document", "type":"string", "indexed":"true",
+    "stored":"true", "multiValued":"true", "required":"true",
+    "default":"__nosecurity__" },
+  { "name":"allow_token_parent",   "type":"string", "indexed":"true",
+    "stored":"true", "multiValued":"true", "required":"true",
+    "default":"__nosecurity__" },
+  { "name":"allow_token_share",    "type":"string", "indexed":"true",
+    "stored":"true", "multiValued":"true", "required":"true", 
+    "default":"__nosecurity__" },
+  { "name":"deny_token_document",  "type":"string", "indexed":"true",
+    "stored":"true", "multiValued":"true", "required":"true",
+    "default":"__nosecurity__" },
+  { "name":"deny_token_parent",    "type":"string", "indexed":"true",
+    "stored":"true", "multiValued":"true", "required":"true",
+    "default":"__nosecurity__" },
+  { "name":"deny_token_share",     "type":"string", "indexed":"true",
+    "stored":"true", "multiValued":"true", "required":"true",
+    "default":"__nosecurity__"}
+]}' http://localhost:8983/solr/<collection_name>/schema
+
+Replace <collection_name> with your core or collection name respectively.
+
+The default value of "__nosecurity__" is manadatory because the queries will be
+rewritten to use all of these 6 fields. If a field is missing in the index then
+you will get no results for your search.
 
-The default value of "__nosecurity__" is required by this plugin, so do not forget
-to include it.
+Check the field definitions with
+
+curl http://localhost:8983/solr/<collection_name>/schema/fields
 
 
 Using the Query Parser Plugin
-----------------------------
+-----------------------------
 
 To set up the query parser plugin, modify your solrconfig.xml to add the query parser:
 
@@ -89,7 +126,7 @@ To set up the query parser plugin, modif
 
 Hook up the search component in the solrconfig.xml file wherever you want it, e.g.:
 
-<requestHandler name="search" class="solr.SearchHandler" default="true">
+<requestHandler name="/select" class="solr.SearchHandler">
   <lst name="appends">
     <str name="fq">{!manifoldCFSecurity}</str>
   </lst>
@@ -98,7 +135,7 @@ Hook up the search component in the solr
 
 
 Using the Search Component
-----------------------------
+--------------------------
 
 To set up the search component, modify your solrconfig.xml to add the search component:
 
@@ -111,7 +148,7 @@ To set up the search component, modify y
 
 Hook up the search component in the solrconfig.xml file wherever you want it, e.g.:
 
-<requestHandler name="search" class="solr.SearchHandler" default="true">
+<requestHandler name="/select" class="solr.SearchHandler">
   <arr name="last-components">
     <str>manifoldCFSecurity</str>
   </arr>