jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1662259 - in /jackrabbit/site/live/oak/docs: .DS_Store query/query.html query/solr.html
Date Wed, 25 Feb 2015 16:54:32 GMT
Author: thomasm
Date: Wed Feb 25 16:54:32 2015
New Revision: 1662259

URL: http://svn.apache.org/r1662259
Log:
OAK-936: Site checkin for project Oak Documentation-1.1-SNAPSHOT

Added:
    jackrabbit/site/live/oak/docs/query/solr.html
Modified:
    jackrabbit/site/live/oak/docs/.DS_Store
    jackrabbit/site/live/oak/docs/query/query.html

Modified: jackrabbit/site/live/oak/docs/.DS_Store
URL: http://svn.apache.org/viewvc/jackrabbit/site/live/oak/docs/.DS_Store?rev=1662259&r1=1662258&r2=1662259&view=diff
==============================================================================
Binary files - no diff available.

Modified: jackrabbit/site/live/oak/docs/query/query.html
URL: http://svn.apache.org/viewvc/jackrabbit/site/live/oak/docs/query/query.html?rev=1662259&r1=1662258&r2=1662259&view=diff
==============================================================================
--- jackrabbit/site/live/oak/docs/query/query.html (original)
+++ jackrabbit/site/live/oak/docs/query/query.html Wed Feb 25 16:54:32 2015
@@ -628,101 +628,10 @@ org.apache.jackrabbit.oak.query.QueryEng
 </pre></div></div></div>
 <div class="section">
 <h3>The Lucene Index<a name="The_Lucene_Index"></a></h3>
-<p>Refer to <a href="lucene.html">Lucene Index</a> for details.</p></div>
+<p>See <a href="lucene.html">Lucene Index</a> for details.</p></div>
 <div class="section">
 <h3>The Solr Index<a name="The_Solr_Index"></a></h3>
-<p>The Solr index is mainly meant for full-text search (the &#x2018;contains&#x2019;
type of queries):</p>
-
-<div class="source">
-<pre>//*[jcr:contains(., 'text')]
-</pre></div>
-<p>but is also able to search by path, property restrictions and primary type restrictions.
This means the Solr index in Oak can be used for any type of JCR query.</p>
-<p>Even if it&#x2019;s not just a full-text index, it&#x2019;s recommended
to use it asynchronously (see <tt>Oak#withAsyncIndexing</tt>) because, in most
production scenarios, it&#x2019;ll be a &#x2018;remote&#x2019; index, and therefore
network eventual latency / errors would have less impact on the repository performance. To
set up the Solr index to be asynchronous that has to be defined inside the index definition,
see <a class="externalLink" href="https://issues.apache.org/jira/browse/OAK-980">OAK-980</a></p>
-<p>TODO Node aggregation.</p>
-<div class="section">
-<div class="section">
-<h5>Index definition for Solr index<a name="Index_definition_for_Solr_index"></a></h5>
-<p><a name="solr-index-definition"></a> The index definition node for a
Solr-based index:</p>
-
-<ul>
-  
-<li>must be of type <tt>oak:QueryIndexDefinition</tt></li>
-  
-<li>must have the <tt>type</tt> property set to <b><tt>solr</tt></b></li>
-  
-<li>must contain the <tt>async</tt> property set to the value <tt>async</tt>,
this is what sends the</li>
-</ul>
-<p>index update process to a background thread.</p>
-<p><i>Optionally</i> one can add</p>
-
-<ul>
-  
-<li>the <tt>reindex</tt> flag which when set to <tt>true</tt>,
triggers a full content re-index.</li>
-</ul>
-<p>Example:</p>
-
-<div class="source">
-<pre>{
-  NodeBuilder index = root.child(&quot;oak:index&quot;);
-  index.child(&quot;solr&quot;)
-    .setProperty(&quot;jcr:primaryType&quot;, &quot;oak:QueryIndexDefinition&quot;,
Type.NAME)
-    .setProperty(&quot;type&quot;, &quot;solr&quot;)
-    .setProperty(&quot;async&quot;, &quot;async&quot;)
-    .setProperty(&quot;reindex&quot;, true);
-}
-</pre></div></div></div>
-<div class="section">
-<h4>Setting up the Solr server<a name="Setting_up_the_Solr_server"></a></h4>
-<p>For the Solr index to work Oak needs to be able to communicate with a Solr instance
/ cluster. Apache Solr supports multiple deployment architectures: </p>
-
-<ul>
-  
-<li>embedded Solr instance running in the same JVM the client runs into</li>
-  
-<li>single remote instance</li>
-  
-<li>master / slave architecture, eventually with multiple shards and replicas</li>
-  
-<li>SolrCloud cluster, with Zookeeper instance(s) to control a dynamic, resilient set
of Solr servers for high  availability and fault tolerance</li>
-</ul>
-<p>The Oak Solr index can be configured to either use an &#x2018;embedded Solr
server&#x2019; or a &#x2018;remote Solr server&#x2019; (being able to connect
to a single remote instance or to a SolrCloud cluster via Zookeeper).</p>
-<div class="section">
-<h5>OSGi environment<a name="OSGi_environment"></a></h5>
-<p>All the Solr configuration parameters are described in the &#x2018;Solr Server
Configuration&#x2019; section on the <a href="osgi_config.html">OSGi configuration</a>
page.</p>
-<p>Create an index definition for the Solr index, as described <a href="#solr-index-definition">above</a>.
Once the query index definition node has been created, access OSGi ConfigurationAdmin via
e.g. Apache Felix WebConsole:</p>
-
-<ol style="list-style-type: decimal">
-  
-<li>find the &#x2018;Oak Solr indexing / search configuration&#x2019; item
and eventually change configuration properties as needed</li>
-  
-<li>find either the &#x2018;Oak Solr embedded server configuration&#x2019;
or &#x2018;Oak Solr remote server configuration&#x2019; items depending  on the chosen
Solr architecture and eventually change configuration properties as needed</li>
-  
-<li>find the &#x2018;Oak Solr server provider&#x2019; item and select the chosen
provider (&#x2018;remote&#x2019; or &#x2018;embedded&#x2019;)</li>
-</ol></div>
-<div class="section">
-<h5>Solr server configurations<a name="Solr_server_configurations"></a></h5>
-<p>Depending on the use case, different Solr server configurations are recommended.</p>
-<div class="section">
-<h6>Embedded Solr server<a name="Embedded_Solr_server"></a></h6>
-<p>The embedded Solr server is recommended for developing and testing the Solr index
for an Oak repository. With that an in-memory Solr instance is started in the same JVM of
the Oak repository, without HTTP bindings (for security purposes as it&#x2019;d allow
HTTP access to repository data independently of ACLs). Configuring an embedded Solr server
mainly consists of providing the path to a standard <a class="externalLink" href="https://wiki.apache.org/solr/SolrTerminology">Solr
home dir</a> (<i>solr.home.path</i> Oak property) to be used to start Solr;
this path can be either relative or absolute, if such a path would not exist then the default
configuration provided with <i>oak-solr-core</i> artifact would be put in the
given path. To start an embedded Solr server with a custom configuration (e.g. different schema.xml
/ solrconfig.xml than the default  ones) the (modified) Solr home files would have to be put
in a dedicated directory, according to Solr home structure, so  that th
 e solr.home.path property can be pointed to that directory.</p></div>
-<div class="section">
-<h6>Single remote Solr server<a name="Single_remote_Solr_server"></a></h6>
-<p>A single (remote) Solr instance is the simplest possible setup for using the Oak
Solr index in a production environment. Oak will communicate to such a Solr server through
Solr&#x2019;s HTTP APIs (via <a class="externalLink" href="http://wiki.apache.org/solr/Solrj">SolrJ</a>
client). Configuring a single remote Solr instance consists of providing the URL to connect
to in order to reach the <a class="externalLink" href="https://wiki.apache.org/solr/SolrTerminology">Solr
core</a> that will host the Solr index for the Oak repository via the <i>solr.http.url</i>
 property which will have to contain such a URL (e.g. _<a class="externalLink" href="http://10.10.1.101:8983/solr/oak_)">http://10.10.1.101:8983/solr/oak_)</a>.
All the configuration and tuning of Solr, other than what&#x2019;s described in &#x2018;Solr
Server Configuration&#x2019; section of the <a href="osgi_config.html">OSGi configuration</a>
page, will have to be performed on the Solr side; <a class="externalLink" href="h
 ttp://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/">sample
Solr configuration</a> files (schema.xml,  solrconfig.xml, etc.) to start with can be
found in <i>oak-solr-core</i> artifact.</p></div>
-<div class="section">
-<h6>SolrCloud cluster<a name="SolrCloud_cluster"></a></h6>
-<p>A <a class="externalLink" href="https://cwiki.apache.org/confluence/display/solr/SolrCloud">SolrCloud</a>
cluster is the recommended setup for an Oak Solr index in production as it provides a scalable
and fault tolerant architecture. In order to configure a SolrCloud cluster the host of the
Zookeeper instance / ensemble managing the Solr servers has to be provided in the <i>solr.zk.host</i>
property (e.g. <i>10.1.1.108:9983</i>) since the SolrJ client for SolrCloud communicates
directly with Zookeeper. The <a class="externalLink" href="https://wiki.apache.org/solr/SolrTerminology">Solr
collection</a> to be used within Oak is named <i>oak</i>, having a replication
 factor of 2 and using 2 shards; this means in the default setup the SolrCloud cluster would
have to be composed by at  least 4 Solr servers as the index will be split into 2 shards and
each shard will have 2 replicas. Such parameters can  be changed, look for the &#x2018;Oak
Solr remote server configuration&#x2019; item
  on the <a href="osgi_config.html">OSGi configuration</a> page. SolrCloud also
allows the hot deploy of configuration files to be used for a certain collection so while
setting up the  collection to be used for Oak with the needed files before starting the cluster,
configuration files can also be uploaded  from a local directory, this is controlled by the
<i>solr.conf.dir</i> property of the &#x2018;Oak Solr remote server configuration&#x2019;.
For a detailed description of how SolrCloud works see the <a class="externalLink" href="https://cwiki.apache.org/confluence/display/solr/SolrCloud">Solr
reference guide</a>.</p></div></div></div>
-<div class="section">
-<h4>Differences with the Lucene index<a name="Differences_with_the_Lucene_index"></a></h4>
-<p>As of Oak version 1.0.0:</p>
-
-<ul>
-  
-<li>Solr index doesn&#x2019;t support search using relative properties, see <a
class="externalLink" href="https://issues.apache.org/jira/browse/OAK-1835">OAK-1835</a>.</li>
-  
-<li>Solr configuration is mostly done on the Solr side via schema.xml / solrconfig.xml
files.</li>
-  
-<li>Lucene can only be used for full-text queries, Solr can be used for full-text search
<i>and</i> for JCR queries involving path, property and primary type restrictions.</li>
-</ul></div></div>
+<p>See <a href="lucene.html">Solr Index</a> for details.</p></div>
 <div class="section">
 <h3>The Node Type Index<a name="The_Node_Type_Index"></a></h3>
 <p>The <tt>NodeTypeIndex</tt> implements a <tt>QueryIndex</tt>
using <tt>PropertyIndexLookup</tt>s on <tt>jcr:primaryType</tt> <tt>jcr:mixinTypes</tt>
to evaluate a node type restriction on the filter. The cost for this index is the sum of the
costs of the <tt>PropertyIndexLookup</tt> for queries on <tt>jcr:primaryType</tt>
and <tt>jcr:mixinTypes</tt>.</p></div>

Added: jackrabbit/site/live/oak/docs/query/solr.html
URL: http://svn.apache.org/viewvc/jackrabbit/site/live/oak/docs/query/solr.html?rev=1662259&view=auto
==============================================================================
--- jackrabbit/site/live/oak/docs/query/solr.html (added)
+++ jackrabbit/site/live/oak/docs/query/solr.html Wed Feb 25 16:54:32 2015
@@ -0,0 +1,559 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia at 2015-02-25
+ | Rendered using Apache Maven Fluido Skin 1.3.0
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="Date-Revision-yyyymmdd" content="20150225" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>Jackrabbit Oak - </title>
+    <link rel="stylesheet" href="../css/apache-maven-fluido-1.3.0.min.css" />
+    <link rel="stylesheet" href="../css/site.css" />
+    <link rel="stylesheet" href="../css/print.css" media="print" />
+
+      
+    <script type="text/javascript" src="../js/apache-maven-fluido-1.3.0.min.js"></script>
+
+    
+            </head>
+        <body class="topBarEnabled">
+          
+    
+    
+            
+    
+    
+    <a href="http://github.com/apache/jackrabbit-oak">
+      <img style="position: absolute; top: 0; right: 0; border: 0; z-index: 10000;"
+        src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"
+        alt="Fork me on GitHub">
+    </a>
+  
+                
+                    
+                
+
+    <div id="topbar" class="navbar navbar-fixed-top ">
+      <div class="navbar-inner">
+                <div class="container-fluid">
+        <a data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </a>
+                
+                                                                                <a class="brand"
href="../"  title="Oak logo">
+
+                                
+                                                                                        
                           <img src="../oak_logo.png" alt="Oak logo" />
+                
+                </a>
+                    
+                                <ul class="nav">
+                          <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Overview <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="../index.html"  title="Jackrabbit Oak">Jackrabbit
Oak</a>
+</li>
+                  
+                      <li>      <a href="../license.html"  title="License">License</a>
+</li>
+                  
+                      <li>      <a href="../downloads.html"  title="Downloads">Downloads</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Concepts and Architecture
<b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="../architecture/overview.html"  title="Overview">Overview</a>
+</li>
+                  
+                      <li>      <a href="../architecture/nodestate.html"  title="The
Node State Model">The Node State Model</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Main APIs <b
class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="http://www.day.com/specs/jcr/2.0/index.html"
 title="JCR API">JCR API</a>
+</li>
+                  
+                      <li>      <a href="../oak_api/overview.html"  title="Oak API">Oak
API</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Features and Plugins
<b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="../nodestore/overview.html"  title="Node
Storage">Node Storage</a>
+</li>
+                  
+                      <li>      <a href="../plugins/blobstore.html"  title="Blob
Storage">Blob Storage</a>
+</li>
+                  
+                      <li>      <a href="../query/query.html"  title="Query">Query</a>
+</li>
+                  
+                      <li>      <a href="../security/overview.html"  title="Security">Security</a>
+</li>
+                  
+                      <li>      <a href="../clustering.html"  title="Clustering">Clustering</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Using Oak <b
class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="../use_getting_started.html"  title="Getting
Started">Getting Started</a>
+</li>
+                  
+                      <li>      <a href="../construct.html"  title="Repository Construction">Repository
Construction</a>
+</li>
+                  
+                      <li>      <a href="../osgi_config.html"  title="Configuring
Oak">Configuring Oak</a>
+</li>
+                  
+                      <li>      <a href="../command_line.html"  title="Command Line
Tools">Command Line Tools</a>
+</li>
+                  
+                      <li>      <a href="../differences.html"  title="Differences
to Jackrabbit 2">Differences to Jackrabbit 2</a>
+</li>
+                  
+                      <li>      <a href="../known_issues.html"  title="Known Issues">Known
Issues</a>
+</li>
+                  
+                      <li>      <a href="../dos_and_donts.html"  title="Dos and
Don'ts">Dos and Don'ts</a>
+</li>
+                  
+                      <li>      <a href="../coldstandby/coldstandby.html"  title="Cold
Standby">Cold Standby</a>
+</li>
+                  
+                      <li>      <a href="../FAQ.html"  title="FAQ">FAQ</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Developing Oak <b
class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="../dev_getting_started.html"  title="Getting
Started">Getting Started</a>
+</li>
+                  
+                      <li>      <a href="../participating.html"  title="Participating">Participating</a>
+</li>
+                  
+                      <li>      <a href="../apidocs/index.html"  title="API Docs">API
Docs</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Links <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="http://jackrabbit.apache.org/oak"  title="Apache
Jackrabbit Oak">Apache Jackrabbit Oak</a>
+</li>
+                  
+                      <li>      <a href="http://jackrabbit.apache.org/"  title="Apache
Jackrabbit">Apache Jackrabbit</a>
+</li>
+                          </ul>
+      </li>
+                  </ul>
+          
+          
+          
+                   
+                      </div>
+          
+        </div>
+      </div>
+    </div>
+    
+        <div class="container-fluid">
+          <div id="banner">
+        <div class="pull-left">
+                                <div id="bannerLeft">
+                <h2>Oak Documentation</h2>
+                </div>
+                      </div>
+        <div class="pull-right">  </div>
+        <div class="clear"><hr/></div>
+      </div>
+
+      <div id="breadcrumbs">
+        <ul class="breadcrumb">
+                
+                    
+                  <li id="publishDate">Last Published: 2015-02-25</li>
+                  <li class="divider">|</li> <li id="projectVersion">Version:
1.1-SNAPSHOT</li>
+                      
+                
+                    
+      
+                            </ul>
+      </div>
+
+            
+      <div class="row-fluid">
+        <div id="leftColumn" class="span3">
+          <div class="well sidebar-nav">
+                
+                    
+                <ul class="nav nav-list">
+                    <li class="nav-header">Overview</li>
+                                
+      <li>
+    
+                          <a href="../index.html" title="Jackrabbit Oak">
+          <i class="none"></i>
+        Jackrabbit Oak</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../license.html" title="License">
+          <i class="none"></i>
+        License</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../downloads.html" title="Downloads">
+          <i class="none"></i>
+        Downloads</a>
+            </li>
+                              <li class="nav-header">Concepts and Architecture</li>
+                                
+      <li>
+    
+                          <a href="../architecture/overview.html" title="Overview">
+          <i class="none"></i>
+        Overview</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../architecture/nodestate.html" title="The Node State
Model">
+          <i class="none"></i>
+        The Node State Model</a>
+            </li>
+                              <li class="nav-header">Main APIs</li>
+                                
+      <li>
+    
+                          <a href="http://www.day.com/specs/jcr/2.0/index.html" class="externalLink"
title="JCR API">
+          <i class="none"></i>
+        JCR API</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../oak_api/overview.html" title="Oak API">
+          <i class="none"></i>
+        Oak API</a>
+            </li>
+                              <li class="nav-header">Features and Plugins</li>
+                                
+      <li>
+    
+                          <a href="../nodestore/overview.html" title="Node Storage">
+          <i class="none"></i>
+        Node Storage</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../plugins/blobstore.html" title="Blob Storage">
+          <i class="none"></i>
+        Blob Storage</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../query/query.html" title="Query">
+          <i class="none"></i>
+        Query</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../security/overview.html" title="Security">
+          <i class="none"></i>
+        Security</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../clustering.html" title="Clustering">
+          <i class="none"></i>
+        Clustering</a>
+            </li>
+                              <li class="nav-header">Using Oak</li>
+                                
+      <li>
+    
+                          <a href="../use_getting_started.html" title="Getting Started">
+          <i class="none"></i>
+        Getting Started</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../construct.html" title="Repository Construction">
+          <i class="none"></i>
+        Repository Construction</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../osgi_config.html" title="Configuring Oak">
+          <i class="none"></i>
+        Configuring Oak</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../command_line.html" title="Command Line Tools">
+          <i class="none"></i>
+        Command Line Tools</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../differences.html" title="Differences to Jackrabbit
2">
+          <i class="none"></i>
+        Differences to Jackrabbit 2</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../known_issues.html" title="Known Issues">
+          <i class="none"></i>
+        Known Issues</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../dos_and_donts.html" title="Dos and Don'ts">
+          <i class="none"></i>
+        Dos and Don'ts</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../coldstandby/coldstandby.html" title="Cold Standby">
+          <i class="none"></i>
+        Cold Standby</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../FAQ.html" title="FAQ">
+          <i class="none"></i>
+        FAQ</a>
+            </li>
+                              <li class="nav-header">Developing Oak</li>
+                                
+      <li>
+    
+                          <a href="../dev_getting_started.html" title="Getting Started">
+          <i class="none"></i>
+        Getting Started</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../participating.html" title="Participating">
+          <i class="none"></i>
+        Participating</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="../apidocs/index.html" title="API Docs">
+          <i class="none"></i>
+        API Docs</a>
+            </li>
+                              <li class="nav-header">Links</li>
+                                
+      <li>
+    
+                          <a href="http://jackrabbit.apache.org/oak" class="externalLink"
title="Apache Jackrabbit Oak">
+          <i class="none"></i>
+        Apache Jackrabbit Oak</a>
+            </li>
+                  
+      <li>
+    
+                          <a href="http://jackrabbit.apache.org/" class="externalLink"
title="Apache Jackrabbit">
+          <i class="none"></i>
+        Apache Jackrabbit</a>
+            </li>
+            </ul>
+                
+                    
+                
+          <hr class="divider" />
+
+           <div id="poweredBy">
+                   
+    <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
+
+    
+    <div class="g-plusone" data-href="http://jackrabbit.apache.org/oak/docs/" data-size="tall"
></div>
+
+                   <div class="clear"></div>
+                            <div class="clear"></div>
+                            <div class="clear"></div>
+                             <a href="http://maven.apache.org/" title="Built by Maven"
class="poweredBy">
+        <img class="builtBy" alt="Built by Maven" src="../images/logos/maven-feather.png"
/>
+      </a>
+                  </div>
+          </div>
+        </div>
+        
+                
+        <div id="bodyColumn"  class="span9" >
+                                  
+            <!-- Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License. --><p>The Solr index is mainly meant for full-text
search (the &#x2018;contains&#x2019; type of queries):</p>
+
+<div class="source">
+<pre>//*[jcr:contains(., 'text')]
+</pre></div>
+<p>but is also able to search by path, property restrictions and primary type restrictions.
This means the Solr index in Oak can be used for any type of JCR query.</p>
+<p>Even if it&#x2019;s not just a full-text index, it&#x2019;s recommended
to use it asynchronously (see <tt>Oak#withAsyncIndexing</tt>) because, in most
production scenarios, it&#x2019;ll be a &#x2018;remote&#x2019; index, and therefore
network eventual latency / errors would have less impact on the repository performance. To
set up the Solr index to be asynchronous that has to be defined inside the index definition,
see <a class="externalLink" href="https://issues.apache.org/jira/browse/OAK-980">OAK-980</a></p>
+<p>TODO Node aggregation.</p>
+<div class="section">
+<div class="section">
+<div class="section">
+<div class="section">
+<h5>Index definition for Solr index<a name="Index_definition_for_Solr_index"></a></h5>
+<p><a name="solr-index-definition"></a> The index definition node for a
Solr-based index:</p>
+
+<ul>
+  
+<li>must be of type <tt>oak:QueryIndexDefinition</tt></li>
+  
+<li>must have the <tt>type</tt> property set to <b><tt>solr</tt></b></li>
+  
+<li>must contain the <tt>async</tt> property set to the value <tt>async</tt>,
this is what sends the</li>
+</ul>
+<p>index update process to a background thread.</p>
+<p><i>Optionally</i> one can add</p>
+
+<ul>
+  
+<li>the <tt>reindex</tt> flag which when set to <tt>true</tt>,
triggers a full content re-index.</li>
+</ul>
+<p>Example:</p>
+
+<div class="source">
+<pre>{
+  NodeBuilder index = root.child(&quot;oak:index&quot;);
+  index.child(&quot;solr&quot;)
+    .setProperty(&quot;jcr:primaryType&quot;, &quot;oak:QueryIndexDefinition&quot;,
Type.NAME)
+    .setProperty(&quot;type&quot;, &quot;solr&quot;)
+    .setProperty(&quot;async&quot;, &quot;async&quot;)
+    .setProperty(&quot;reindex&quot;, true);
+}
+</pre></div></div></div>
+<div class="section">
+<h4>Setting up the Solr server<a name="Setting_up_the_Solr_server"></a></h4>
+<p>For the Solr index to work Oak needs to be able to communicate with a Solr instance
/ cluster. Apache Solr supports multiple deployment architectures: </p>
+
+<ul>
+  
+<li>embedded Solr instance running in the same JVM the client runs into</li>
+  
+<li>single remote instance</li>
+  
+<li>master / slave architecture, eventually with multiple shards and replicas</li>
+  
+<li>SolrCloud cluster, with Zookeeper instance(s) to control a dynamic, resilient set
of Solr servers for high  availability and fault tolerance</li>
+</ul>
+<p>The Oak Solr index can be configured to either use an &#x2018;embedded Solr
server&#x2019; or a &#x2018;remote Solr server&#x2019; (being able to connect
to a single remote instance or to a SolrCloud cluster via Zookeeper).</p>
+<div class="section">
+<h5>OSGi environment<a name="OSGi_environment"></a></h5>
+<p>All the Solr configuration parameters are described in the &#x2018;Solr Server
Configuration&#x2019; section on the <a href="osgi_config.html">OSGi configuration</a>
page.</p>
+<p>Create an index definition for the Solr index, as described <a href="#solr-index-definition">above</a>.
Once the query index definition node has been created, access OSGi ConfigurationAdmin via
e.g. Apache Felix WebConsole:</p>
+
+<ol style="list-style-type: decimal">
+  
+<li>find the &#x2018;Oak Solr indexing / search configuration&#x2019; item
and eventually change configuration properties as needed</li>
+  
+<li>find either the &#x2018;Oak Solr embedded server configuration&#x2019;
or &#x2018;Oak Solr remote server configuration&#x2019; items depending  on the chosen
Solr architecture and eventually change configuration properties as needed</li>
+  
+<li>find the &#x2018;Oak Solr server provider&#x2019; item and select the chosen
provider (&#x2018;remote&#x2019; or &#x2018;embedded&#x2019;)</li>
+</ol></div>
+<div class="section">
+<h5>Solr server configurations<a name="Solr_server_configurations"></a></h5>
+<p>Depending on the use case, different Solr server configurations are recommended.</p>
+<div class="section">
+<h6>Embedded Solr server<a name="Embedded_Solr_server"></a></h6>
+<p>The embedded Solr server is recommended for developing and testing the Solr index
for an Oak repository. With that an in-memory Solr instance is started in the same JVM of
the Oak repository, without HTTP bindings (for security purposes as it&#x2019;d allow
HTTP access to repository data independently of ACLs). Configuring an embedded Solr server
mainly consists of providing the path to a standard <a class="externalLink" href="https://wiki.apache.org/solr/SolrTerminology">Solr
home dir</a> (<i>solr.home.path</i> Oak property) to be used to start Solr;
this path can be either relative or absolute, if such a path would not exist then the default
configuration provided with <i>oak-solr-core</i> artifact would be put in the
given path. To start an embedded Solr server with a custom configuration (e.g. different schema.xml
/ solrconfig.xml than the default  ones) the (modified) Solr home files would have to be put
in a dedicated directory, according to Solr home structure, so  that th
 e solr.home.path property can be pointed to that directory.</p></div>
+<div class="section">
+<h6>Single remote Solr server<a name="Single_remote_Solr_server"></a></h6>
+<p>A single (remote) Solr instance is the simplest possible setup for using the Oak
Solr index in a production environment. Oak will communicate to such a Solr server through
Solr&#x2019;s HTTP APIs (via <a class="externalLink" href="http://wiki.apache.org/solr/Solrj">SolrJ</a>
client). Configuring a single remote Solr instance consists of providing the URL to connect
to in order to reach the <a class="externalLink" href="https://wiki.apache.org/solr/SolrTerminology">Solr
core</a> that will host the Solr index for the Oak repository via the <i>solr.http.url</i>
 property which will have to contain such a URL (e.g. _<a class="externalLink" href="http://10.10.1.101:8983/solr/oak_)">http://10.10.1.101:8983/solr/oak_)</a>.
All the configuration and tuning of Solr, other than what&#x2019;s described in &#x2018;Solr
Server Configuration&#x2019; section of the <a href="osgi_config.html">OSGi configuration</a>
page, will have to be performed on the Solr side; <a class="externalLink" href="h
 ttp://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-solr-core/src/main/resources/solr/">sample
Solr configuration</a> files (schema.xml,  solrconfig.xml, etc.) to start with can be
found in <i>oak-solr-core</i> artifact.</p></div>
+<div class="section">
+<h6>SolrCloud cluster<a name="SolrCloud_cluster"></a></h6>
+<p>A <a class="externalLink" href="https://cwiki.apache.org/confluence/display/solr/SolrCloud">SolrCloud</a>
cluster is the recommended setup for an Oak Solr index in production as it provides a scalable
and fault tolerant architecture. In order to configure a SolrCloud cluster the host of the
Zookeeper instance / ensemble managing the Solr servers has to be provided in the <i>solr.zk.host</i>
property (e.g. <i>10.1.1.108:9983</i>) since the SolrJ client for SolrCloud communicates
directly with Zookeeper. The <a class="externalLink" href="https://wiki.apache.org/solr/SolrTerminology">Solr
collection</a> to be used within Oak is named <i>oak</i>, having a replication
 factor of 2 and using 2 shards; this means in the default setup the SolrCloud cluster would
have to be composed by at  least 4 Solr servers as the index will be split into 2 shards and
each shard will have 2 replicas. Such parameters can  be changed, look for the &#x2018;Oak
Solr remote server configuration&#x2019; item
  on the <a href="osgi_config.html">OSGi configuration</a> page. SolrCloud also
allows the hot deploy of configuration files to be used for a certain collection so while
setting up the  collection to be used for Oak with the needed files before starting the cluster,
configuration files can also be uploaded  from a local directory, this is controlled by the
<i>solr.conf.dir</i> property of the &#x2018;Oak Solr remote server configuration&#x2019;.
For a detailed description of how SolrCloud works see the <a class="externalLink" href="https://cwiki.apache.org/confluence/display/solr/SolrCloud">Solr
reference guide</a>.</p></div></div></div>
+<div class="section">
+<h4>Differences with the Lucene index<a name="Differences_with_the_Lucene_index"></a></h4>
+<p>As of Oak version 1.0.0:</p>
+
+<ul>
+  
+<li>Solr index doesn&#x2019;t support search using relative properties, see <a
class="externalLink" href="https://issues.apache.org/jira/browse/OAK-1835">OAK-1835</a>.</li>
+  
+<li>Solr configuration is mostly done on the Solr side via schema.xml / solrconfig.xml
files.</li>
+  
+<li>Lucene can only be used for full-text queries, Solr can be used for full-text search
<i>and</i> for JCR queries involving path, property and primary type restrictions.</li>
+</ul></div></div></div>
+                  </div>
+            </div>
+          </div>
+
+    <hr/>
+
+    <footer>
+            <div class="container-fluid">
+              <div class="row span12">Copyright &copy;                    2012-2015
+                        <a href="http://www.apache.org/">The Apache Software Foundation</a>.
+            All Rights Reserved.      
+                    
+      </div>
+
+        
+        
+          
+    
+    
+                
+    <div id="ohloh" class="pull-right">
+      <script type="text/javascript" src="http://www.ohloh.net/p/jackrabbit-oak/widgets/project_thin_badge.js"></script>
+    </div>
+        </div>
+    </footer>
+  </body>
+</html>
\ No newline at end of file



Mime
View raw message