SOLR-3288: minor updates to the tutorial (mostly typo fixes) and improvements to the various README files in the example -- mostly related to SolrHome dir vs SolrCore instance dir

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1384895 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris M. Hostetter 2012-09-14 19:23:16 +00:00
parent 1de28d8c21
commit 609396c37d
5 changed files with 137 additions and 62 deletions

View File

@ -133,7 +133,7 @@ The <span class="codefrag">exampledocs</span> directory contains sample files
showing of the types of commands Solr accepts, as well as a java utility
for posting them from the command line (a <span class="codefrag">post.sh</span>
shell script is also available, but for this tutorial we'll use the
cross-platform Java client).
cross-platform Java client. Run <span class="codefrag">java -jar post.jar -h</span> so see it's various options).
</p>
<p> To try this, open a new terminal window, enter the exampledocs directory,
and run "<span class="codefrag">java -jar post.jar</span>" on some of the XML
@ -293,9 +293,9 @@ Here is an example of using delete-by-query to delete anything with
<pre class="code">java -Dcommit=false -Ddata=args -jar post.jar "&lt;delete&gt;&lt;query&gt;name:DDR&lt;/query&gt;&lt;/delete&gt;"</pre>
<p>
You can force a new searcher to be opened to reflect these changes by sending a commit command to Solr (which post.jar does for you by default):
You can force a new searcher to be opened to reflect these changes by sending an explicit commit command to Solr:
</p>
<pre class="code">java -jar post.jar</pre>
<pre class="code">java -jar post.jar -</pre>
<p>
Now re-execute <a href="http://localhost:8983/solr/#/collection1/query?q=id:SP2514N">the previous search</a>
@ -396,7 +396,7 @@ and is useful when testing or debugging queries.
<ul>
<li>
<a href="http://localhost:8983/solr/collection1/select/?indent=on&amp;q=*:*&amp;sort=div(popularity,add(price,1))+desc">q=video&amp;sort=div(popularity,add(price,1)) desc</a>
<a href="http://localhost:8983/solr/collection1/select/?indent=on&amp;q=video&amp;sort=div(popularity,add(price,1))+desc">q=video&amp;sort=div(popularity,add(price,1)) desc</a>
</li>
</ul>
@ -479,7 +479,7 @@ and is useful when testing or debugging queries.
</p>
<p>
<a href="http://localhost:8983/solr/collection1/select/?wt=json&amp;indent=on&amp;q=*:*&amp;fl=name,manufacturedate_dt&amp;facet=true&amp;facet.range=manufacturedate_dt&amp;facet.range.start=2004-01-01T00:00:00Z&amp;facet.range.end=2010-01-01T00:00:00Z&amp;facet.range.gap=%2b1YEAR">...&amp;q=*:*&amp;facet=true&amp;facet.rage=manufacturedate_dt&amp;facet.rage.start=2004-01-01T00:00:00Z&amp;facet.rage.end=2010-01-01T00:00:00Z&amp;facet.range.gap=+1YEAR</a>
<a href="http://localhost:8983/solr/collection1/select/?wt=json&amp;indent=on&amp;q=*:*&amp;fl=name,manufacturedate_dt&amp;facet=true&amp;facet.range=manufacturedate_dt&amp;facet.range.start=2004-01-01T00:00:00Z&amp;facet.range.end=2010-01-01T00:00:00Z&amp;facet.range.gap=%2b1YEAR">...&amp;q=*:*&amp;facet=true&amp;facet.range=manufacturedate_dt&amp;facet.range.start=2004-01-01T00:00:00Z&amp;facet.range.end=2010-01-01T00:00:00Z&amp;facet.range.gap=+1YEAR</a>
</p>
<p>
@ -538,7 +538,7 @@ most languages.
If you know your textual content is English, as is the case for the example
documents in this tutorial, and you'd like to apply English-specific stemming
and stop word removal, as well as split compound words, you can use the
<a href="http://localhost:8983/solr/#/collection1/schema-browser?type=text_en_splitting"><span class="codefrag">text_en_splitting</span> fieldType</a> instead.
<a href="http://localhost:8983/solr/#/collection1/schema-browser?type=text_en_splitting"><span class="codefrag">text_en_splitting</span></a> fieldType instead.
Go ahead and edit the <span class="codefrag">schema.xml</span> in the
<span class="codefrag">solr/example/solr/collection1/conf</span> directory,
to use the <span class="codefrag">text_en_splitting</span> fieldType for
@ -596,7 +596,7 @@ There is a handy <a href="http://localhost:8983/solr/#/collection1/analysis">Ana
where you can see how a text value is broken down into words by both Index time nad Query time analysis chains for a field or field type. This page shows the resulting tokens after they pass through each filter in the chains.
</p>
<p>
<a href="http://localhost:8983/solr/#/collection1/analysis?analysis.fieldvalue=Canon+Power-Shot+SD500&analysis.query=&analysis.fieldtype=text_en_splitting">This url</a>
<a href="http://localhost:8983/solr/#/collection1/analysis?analysis.fieldvalue=Canon+Power-Shot+SD500&amp;analysis.query=&amp;analysis.fieldtype=text_en_splitting">This url</a>
shows the tokens created from
"<span class="codefrag">Canon Power-Shot SD500</span>"
using the
@ -607,14 +607,14 @@ where you can see how a text value is broken down into words by both Index time
<span class="codefrag">power</span>, <span class="codefrag">shot</span>
are indexed, using tokens that have the same "position".
(Compare the previous output with
<a href="http://localhost:8983/solr/#/collection1/analysis?analysis.fieldvalue=Canon+Power-Shot+SD500&analysis.query=&analysis.fieldtype=text_general">The tokens produced using the text_general field type</a>.)
<a href="http://localhost:8983/solr/#/collection1/analysis?analysis.fieldvalue=Canon+Power-Shot+SD500&amp;analysis.query=&amp;analysis.fieldtype=text_general">The tokens produced using the text_general field type</a>.)
</p>
<p>
Mousing over the section label to the left of the section will display the full name of the analyzer component at that stage of the chain. Toggling the "Verbose Output" checkbox will show/hide the detailed token attributes.
</p>
<p>
When both <a href="http://localhost:8983/solr/#/collection1/analysis?analysis.fieldvalue=Canon+Power-Shot+SD500&analysis.query=power+shot+sd-500&analysis.fieldtype=text_en_splitting">Index and Query</a>
When both <a href="http://localhost:8983/solr/#/collection1/analysis?analysis.fieldvalue=Canon+Power-Shot+SD500&amp;analysis.query=power+shot+sd-500&amp;analysis.fieldtype=text_en_splitting">Index and Query</a>
values are provided, two tables will be displayed side by side showing the
results of each chain. Terms in the Index chain results that are equivilent
to the final terms produced by the Query chain will be highlighted.
@ -623,16 +623,16 @@ to the final terms produced by the Query chain will be highlighted.
Other interesting examples:
</p>
<ul>
<li><a href="http://localhost:8983/solr/#/collection1/analysis?analysis.fieldvalue=Four+score+and+seven+years+ago+our+fathers+brought+forth+on+this+continent+a+new+nation%2C+conceived+in+liberty+and+dedicated+to+the+proposition+that+all+men+are+created+equal.%0A&analysis.query=liberties+and+equality&analysis.fieldtype=text_en">English stemming and stop-words</a>
<li><a href="http://localhost:8983/solr/#/collection1/analysis?analysis.fieldvalue=Four+score+and+seven+years+ago+our+fathers+brought+forth+on+this+continent+a+new+nation%2C+conceived+in+liberty+and+dedicated+to+the+proposition+that+all+men+are+created+equal.%0A&amp;analysis.query=liberties+and+equality&amp;analysis.fieldtype=text_en">English stemming and stop-words</a>
using the <span class="codefrag">text_en</span> field type
</li>
<li><a href="http://localhost:8983/solr/#/collection1/analysis?analysis.fieldtype=text_cjk&analysis.fieldvalue=%EF%BD%B6%EF%BE%80%EF%BD%B6%EF%BE%85&analysis.query=%E3%82%AB%E3%82%BF%E3%82%AB%E3%83%8A">Half-width katakana normalization with bi-graming</a>
<li><a href="http://localhost:8983/solr/#/collection1/analysis?analysis.fieldtype=text_cjk&amp;analysis.fieldvalue=%EF%BD%B6%EF%BE%80%EF%BD%B6%EF%BE%85&amp;analysis.query=%E3%82%AB%E3%82%BF%E3%82%AB%E3%83%8A">Half-width katakana normalization with bi-graming</a>
using the <span class="codefrag">text_cjk</span> field type
</li>
<li><a href="http://localhost:8983/solr/#/collection1/analysis?analysis.fieldtype=text_ja&analysis.fieldvalue=%E7%A7%81%E3%81%AF%E5%88%B6%E9%99%90%E3%82%B9%E3%83%94%E3%83%BC%E3%83%89%E3%82%92%E8%B6%85%E3%81%88%E3%82%8B%E3%80%82">Japanese morphological decomposition with part-of-speech filtering</a>
<li><a href="http://localhost:8983/solr/#/collection1/analysis?analysis.fieldtype=text_ja&amp;analysis.fieldvalue=%E7%A7%81%E3%81%AF%E5%88%B6%E9%99%90%E3%82%B9%E3%83%94%E3%83%BC%E3%83%89%E3%82%92%E8%B6%85%E3%81%88%E3%82%8B%E3%80%82">Japanese morphological decomposition with part-of-speech filtering</a>
using the <span class="codefrag">text_ja</span> field type
</li>
<li><a href="http://localhost:8983/solr/#/collection1/analysis?analysis.fieldtype=text_ar&analysis.fieldvalue=%D9%84%D8%A7+%D8%A3%D8%AA%D9%83%D9%84%D9%85+%D8%A7%D9%84%D8%B9%D8%B1%D8%A8%D9%8A%D8%A9
<li><a href="http://localhost:8983/solr/#/collection1/analysis?analysis.fieldtype=text_ar&amp;analysis.fieldvalue=%D9%84%D8%A7+%D8%A3%D8%AA%D9%83%D9%84%D9%85+%D8%A7%D9%84%D8%B9%D8%B1%D8%A8%D9%8A%D8%A9
">Arabic stop-words, normalization, and stemming</a>
using the <span class="codefrag">text_ar</span> field type
</li>

View File

@ -13,50 +13,66 @@
# See the License for the specific language governing permissions and
# limitations under the License.
Solr example configuration
--------------------------
Solr example
------------
To run the default example configuration, use
This directory contains an instance of the Jetty Servlet container setup to
run Solr using an example configuration.
To run this example:
java -jar start.jar
in this example directory, and when Solr is started connect to
http://localhost:8983/solr/admin/
http://localhost:8983/solr/
To add documents to the index, use the post.jar (or post.sh script) in
the exampledocs subdirectory (while Solr is running), for example:
the example/exampledocs subdirectory (while Solr is running), for example:
cd exampledocs
java -jar post.jar *.xml
Or: sh post.sh *.xml
See also README.txt in the solr subdirectory, and check
http://wiki.apache.org/solr/SolrResources for a list of tutorials and
introductory articles.
For more information about this example please read...
NOTE: This Solr example server references certain Solr jars outside of
this server directory for non-core modules with <lib> statements in
solrconfig.xml. If you make a copy of this example server and wish
to use the ExtractingRequestHandler (SolrCell), DataImportHandler (DIH),
UIMA, the clustering component, or other modules in "contrib",
you will need to copy the required jars into solr/lib or update the paths to
the jars in your solrconfig.xml.
* example/solr/README.txt
For more information about the "Solr Home" and Solr specific configuration
* http://lucene.apache.org/solr/tutorial.html
For a Tutorial using this example configuration
* http://wiki.apache.org/solr/SolrResources
For a list of other tutorials and introductory articles.
-SolrHome
Notes About These Examples
--------------------------
By default, start.jar starts Solr in Jetty using the default solr home
directory of "./solr/" -- To run other example configurations, you can
speciy the solr.solr.home system property when starting jetty...
* SolrHome *
By default, start.jar starts Solr in Jetty using the default Solr Home
directory of "./solr/" (relative to the working directory of hte servlet
container). To run other example configurations, you can specify the
solr.solr.home system property when starting jetty...
java -Dsolr.solr.home=multicore -jar start.jar
java -Dsolr.solr.home=example-DIH -jar start.jar
-Logging
* References to Jar Files Outside This Directory *
By default, Solr will log to the console. This can be convenient when first
getting started, but eventually you will want to log to a file. To enable
logging, you can just pass a system property to Jetty on startup:
Various example SolrHome dirs contained in this directory may use "<lib>"
statements in the solrconfig.xml file to reference plugin jars outside of
this directory for loading "contrib" plugins via relative paths.
If you make a copy of this example server and wish to use the
ExtractingRequestHandler (SolrCell), DataImportHandler (DIH), UIMA, the
clustering component, or any other modules in "contrib", you will need to
copy the required jars or update the paths to those jars in your
solrconfig.xml.
* Logging *
By default, Jetty & Solr will log to the console. This can be convenient when
first getting started, but eventually you will want to log to a file. To
configure logging, you can just pass a system property to Jetty on startup:
java -Djava.util.logging.config.file=etc/logging.properties -jar start.jar

View File

@ -14,7 +14,7 @@
# limitations under the License.
Example "Solr Home" Directory
Example Solr Home Directory
=============================
This directory is provided as an example of what a "Solr Home" directory
@ -27,28 +27,37 @@ directory when setting up a new instance of Solr, but it is recommended.
Basic Directory Structure
-------------------------
The Solr Home directory typically contains the following subdirectories...
The Solr Home directory typically contains the following...
conf/
This directory is mandatory and must contain your solrconfig.xml
and schema.xml. Any other optional configuration files would also
be kept here.
* solr.xml *
data/
This directory is the default location where Solr will keep your
index, and is used by the replication scripts for dealing with
snapshots. You can override this location in the solrconfig.xml
and scripts.conf files. Solr will create this directory if it
does not already exist.
This is the primary configuration file Solr looks for when starting.
This file specifies the list of "SolrCores" it should load, and high
level configuration options that should be used for all SolrCores.
lib/
This directory is optional. If it exists, Solr will load any Jars
found in this directory and use them to resolve any "plugins"
specified in your solrconfig.xml or schema.xml (ie: Analyzers,
Request Handlers, etc...). Alternatively you can use the <lib>
syntax in solrconfig.xml to direct Solr to your plugins. See the
example solrconfig.xml file for details.
Please see the comments in ./solr.xml for more details.
bin/
This directory is optional. It is the default location used for
keeping the replication scripts.
If no solr.xml file is found, then Solr assumes that there should be
a single SolrCore named "collection1" and that the "Instance Directory"
for collection1 should be the same as the Solr Home Directory.
* Individual SolrCore Instance Directories *
Although solr.xml can be configured to look for SolrCore Instance Directories
in any path, simple sub-directories of the Solr Home Dir using relative paths
are common for many installations. In this directory you can see the
"./collection1" Instance Directory.
* A Shared 'lib' Directory *
Although solr.xml can be configured with an optional "sharedLib" attribute
that can point to any path, it is common to use a "./lib" sub-directory of the
Solr Home Directory.
* ZooKeeper Files *
When using SolrCloud using the embedded ZooKeeper option for Solr, it is
common to have a "zoo.cfg" file and "zoo_data" directories in the Solr Home
Directory. Please see the SolrCloud wiki page for more details...
https://wiki.apache.org/solr/SolrCloud

View File

@ -0,0 +1,50 @@
# 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.
Example SolrCore Instance Directory
=============================
This directory is provided as an example of what an "Instance Directory"
should look like for a SolrCore
It's not strictly necessary that you copy all of the files in this
directory when setting up a new SolrCores, but it is recommended.
Basic Directory Structure
-------------------------
The Solr Home directory typically contains the following sub-directories...
conf/
This directory is mandatory and must contain your solrconfig.xml
and schema.xml. Any other optional configuration files would also
be kept here.
data/
This directory is the default location where Solr will keep your
index, and is used by the replication scripts for dealing with
snapshots. You can override this location in the
conf/solrconfig.xml. Solr will create this directory if it does not
already exist.
lib/
This directory is optional. If it exists, Solr will load any Jars
found in this directory and use them to resolve any "plugins"
specified in your solrconfig.xml or schema.xml (ie: Analyzers,
Request Handlers, etc...). Alternatively you can use the <lib>
syntax in conf/solrconfig.xml to direct Solr to your plugins. See
the example conf/solrconfig.xml file for details.

View File

@ -27,7 +27,7 @@
-->
<!--
All (relative) paths are relative to the installation path
All (relative) paths are relative to the Solr Home Directory
persistent: Save changes made via the API to this file
sharedLib: path to a lib directory that will be shared across all cores