jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r878588 - in /websites/staging/jena/trunk/content: ./ documentation/query/spatial-query.html
Date Mon, 16 Sep 2013 08:11:09 GMT
Author: buildbot
Date: Mon Sep 16 08:11:09 2013
New Revision: 878588

Log:
Staging update by buildbot for jena

Modified:
    websites/staging/jena/trunk/content/   (props changed)
    websites/staging/jena/trunk/content/documentation/query/spatial-query.html

Propchange: websites/staging/jena/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Mon Sep 16 08:11:09 2013
@@ -1 +1 @@
-1523333
+1523557

Modified: websites/staging/jena/trunk/content/documentation/query/spatial-query.html
==============================================================================
--- websites/staging/jena/trunk/content/documentation/query/spatial-query.html (original)
+++ websites/staging/jena/trunk/content/documentation/query/spatial-query.html Mon Sep 16
08:11:09 2013
@@ -161,6 +161,7 @@ for a large scale enterprise search appl
 </li>
 <li><a href="#property-function-library">Property Function Library</a></li>
 <li><a href="#spatial-dataset-assembler">Spatial Dataset Assembler</a></li>
+<li><a href="#working-with-solr">Working with Solr</a></li>
 <li><a href="#working-with-fuseki">Working with Fuseki</a></li>
 <li><a href="#building-a-spatial-index">Building a Spatial Index</a></li>
 </ul>
@@ -367,6 +368,32 @@ You also optionally use JtsSpatialContex
 
 
 <p>Key here is that the assembler contains two dataset definitions, one for the spatial
dataset, one for the base data. Therefore, the application needs to identify the text dataset
by it's URI 'http://localhost/jena_example/#spatial_dataset'.</p>
+<h2 id="working-with-solr">Working with Solr</h2>
+<p>Besides Lucene, jena-spatial can work with Solr for spatial query, powered by <a
href="http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4">Lucene / Solr 4 Spatial</a>
and <a href="http://wiki.apache.org/solr/Solrj">Solrj</a>.</p>
+<p>It's required to add the field definitions for "entityField" and "geoField" respectively
in <code>schema.xml</code> of Solr.
+The names of the fields in <a href="https://svn.apache.org/repos/asf/jena/trunk/jena-spatial/src/main/java/org/apache/jena/query/spatial/EntityDefinition.java">EntityDefinition</a>
should be in accordance with those in <code>schema.xml</code>.
+Here is an example defining the names of "entityField" as "uri" and "geoField" as "geo":</p>
+<div class="codehilite"><pre><span class="o">&lt;</span><span
class="n">field</span> <span class="n">name</span><span class="p">=</span>&quot;<span
class="n">uri</span>&quot; <span class="n">type</span><span class="p">=</span>&quot;<span
class="n">string</span>&quot; <span class="n">indexed</span><span
class="p">=</span>&quot;<span class="n">true</span>&quot; <span
class="n">stored</span><span class="p">=</span>&quot;<span class="n">true</span>&quot;
<span class="n">required</span><span class="p">=</span>&quot;<span
class="n">true</span>&quot; <span class="n">multiValued</span><span
class="p">=</span>&quot;<span class="n">false</span>&quot; <span
class="o">/&gt;</span> 
+<span class="o">&lt;</span><span class="n">field</span> <span
class="n">name</span><span class="p">=</span>&quot;<span class="n">geo</span>&quot;
 <span class="n">type</span><span class="p">=</span>&quot;<span
class="n">location_rpt</span>&quot;  <span class="n">indexed</span><span
class="p">=</span>&quot;<span class="n">true</span>&quot; <span
class="n">stored</span><span class="p">=</span>&quot;<span class="n">true</span>&quot;
 <span class="n">multiValued</span><span class="p">=</span>&quot;<span
class="n">true</span>&quot; <span class="o">/&gt;</span>
+</pre></div>
+
+
+<p>The fieldType of "entityField" is <code>string</code>, while that of
"geoField" is <code>location_rpt</code>:</p>
+<div class="codehilite"><pre><span class="o">&lt;</span><span
class="n">fieldType</span> <span class="n">name</span><span class="p">=</span>&quot;<span
class="n">string</span>&quot; <span class="n">class</span><span
class="p">=</span>&quot;<span class="n">solr</span><span class="p">.</span><span
class="n">StrField</span>&quot; <span class="n">sortMissingLast</span><span
class="p">=</span>&quot;<span class="n">true</span>&quot; <span
class="o">/&gt;</span>
+<span class="o">&lt;</span><span class="n">fieldType</span> <span
class="n">name</span><span class="p">=</span>&quot;<span class="n">location_rpt</span>&quot;
<span class="n">class</span><span class="p">=</span>&quot;<span
class="n">solr</span><span class="p">.</span><span class="n">SpatialRecursivePrefixTreeFieldType</span>&quot;
<span class="n">geo</span><span class="p">=</span>&quot;<span
class="n">true</span>&quot; <span class="n">distErrPct</span><span
class="p">=</span>&quot;0<span class="p">.</span>025&quot; <span
class="n">maxDistErr</span><span class="p">=</span>&quot;0<span
class="p">.</span>000009&quot; <span class="n">units</span><span
class="p">=</span>&quot;<span class="n">degrees</span>&quot;
<span class="o">/&gt;</span>
+</pre></div>
+
+
+<p>Addtionally, in <code>solrconfig.xml</code>, there should be 2 <code>requestHandlers</code>
defined for querying and updating the spatial data and the index.</p>
+<div class="codehilite"><pre><span class="nt">&lt;requestHandler</span>
<span class="na">name=</span><span class="s">&quot;/select&quot;</span>
<span class="na">class=</span><span class="s">&quot;solr.SearchHandler&quot;</span><span
class="nt">&gt;&lt;/requestHandler&gt;</span>
+<span class="nt">&lt;requestHandler</span> <span class="na">name=</span><span
class="s">&quot;/update&quot;</span> <span class="na">class=</span><span
class="s">&quot;solr.UpdateRequestHandler&quot;</span><span class="nt">&gt;&lt;/requestHandler&gt;</span>
+</pre></div>
+
+
+<p>The above is the least required configuration to run jena-spatial in Solr.
+For more information about the configuration, please check the <a href="http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4">Lucene
/ Solr 4 Spatial</a> documentation.</p>
+<p>There're also some demostrations of the usage of Solr in the <a href="https://svn.apache.org/repos/asf/jena/trunk/jena-spatial/src/test/java/org/apache/jena/query/spatial/pfunction/solr">unit
tests</a> of jena-spatial.
+They use a <code>EmbeddedSolrServer</code>with a <code>SOLR_HOME</code>
sample <a href="https://svn.apache.org/repos/asf/jena/trunk/jena-spatial/src/test/resources/SolrHome">here</a>.</p>
 <h2 id="working-with-fuseki">Working with Fuseki</h2>
 <p>The Fuseki configuration simply points to the spatial dataset as the fuseki:dataset
of the service.</p>
 <div class="codehilite"><pre><span class="o">&lt;</span>#<span
class="n">service_spatial_tdb</span><span class="o">&gt;</span> <span
class="n">rdf</span><span class="p">:</span><span class="n">type</span>
<span class="n">fuseki</span><span class="p">:</span><span class="n">Service</span>
<span class="p">;</span>



Mime
View raw message