You are on page 1of 7

SOLR

Servers:

The Solr instance solr-addresses and solr-customers is deployed in below location:
test: /apps/triple/dev/tomcat on pico4
prod: same server as SPOC Salg

Requirements
Java 1.5 or greater installed. (Note: starting with Solr 4, Java 1.6 will be required)
A servlet container such as Tomcat, Jetty, or Resin
A Solr distribution (Or a Nightly build if you want the latest)
Although Solr strives to be agnostic of the Locale where the server is running, some code
paths may inadvertently be depending on the System default Locale, or Charset. (In particular,
there are known bugs in Sun's JVM dealing with XSLTs in non English locales) It is recom-
mended that when running Solr you set the following system properties: -Duser.language=en -
Duser.country=US
For full international charset support, please make sure you use a full Java JDK, as opposed
to the default JRE which is pre-installed on many computers
Setup
Download and install Tomcat for Windows using the MSI installer. Install it with the tcnative.dll
file. Say you installed it in c:\tomcat\
Check if Tomcat is installed correctly by going to http://localhost:8080/
Change the c:\tomcat\conf\server.xml file to add the URIEncoding Connector element as
shown above.
Download and unzip the Solr distribution zip file into (say) c:\temp\solrZip\
Make the "solr home" directory called, where you intend the application server to function, say
c:\web\solr\
Copy the contents of the example\solr directory c:\temp\solrZip\example\solr\ to c:\web\solr\
Stop the Tomcat service
Copy the *solr*.war file from c:\temp\solrZip\dist\ to the Tomcat webapps directory
c:\tomcat\webapps\
Rename the *solr*.war file solr.war
Configure Tomcat to recognize the solr home directory you created, by adding the Java Op-
tions -Dsolr.solr.home=c:\web\solr and -Dsolr.velocity.enabled=false
either use the system tray icon to add the java option
or manually edit the environment script c:\tomcat\bin\setenv.bat and add it to JAVA_OPTS
Note: For Tomcat 7 and Solr3.4(last version on 2011-09-23), the above option on setenv.bat
may not work, so you could not use it and put this code fragment
on $CATALINA_HOME/conf/Catalina/localhost/solr.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="C:\apache-tomcat-7.0.21\webapps\solr.war" debug="0" crossCon-
text="true" >
<Environment name="solr/home" type="java.lang.String" value="C:\solr" over-
ride="true"/>
</Context>
Start the Tomcat service
Go to the solr admin page to verify that the installation is working. It will be at
http://localhost:8080/solr/admin Single Solr app.

Configuring Solr
Solr is configured using three main files...
solr.xml - Solr.xml 4.4 and beyond or Solr.xml (supported through 4.x)
solrconfig.xml - SolrConfigXml : http://wiki.apache.org/solr/SolrConfigXml
schema.xml - SchemaXml : http://wiki.apache.org/solr/SchemaXml

The central directory for Solr is known as solr.solr.home, or solr/home in servlet container configs. If
this property is not defined, it defaults to "./solr" - a directory named solr in the current working direc-
tory.
The solr.xml file is the first config file that Solr tries to find, and it looks in solr.solr.home. This gives
Solr global config information and tells it where to find its cores. The rest of the config comes from
each defined core. If solr.xml does not exist, Solr will attempt to start in single-core mode. Support for
single-core mode is likely to be removed in version 5.0.
In each core, Solr will look for a conf/solrconfig.xml file. The solrconfig may point Solr at other config
files, like conf/dih-config.xml for the dataimport handler. Unless the config filename is changed in
solrconfig.xml, conf/schema.xml will be used to load the schema.
The central directory for Solr is known as solr.solr.home, or solr/home in servlet container configs. If
this property is not defined, it defaults to "./solr" - a directory named solr in the current working direc-
tory.
The solr.xml file is the first config file that Solr tries to find, and it looks in solr.solr.home. This gives
Solr global config information and tells it where to find its cores. The rest of the config comes from
each defined core. If solr.xml does not exist, Solr will attempt to start in single-core mode.

Solr Admin

Description of Solr Links :
Solr Link Displays
SCHEMA Displays the XML schema file that defines the collection for this Solr instance.
CONFIG Displays the Solr configuration file, solrconfig.xml.
ANALYSIS
Links to the Field Analysis GUI for testing out how the Analyzers for different fields
will behave
STATISTICS
Displays a subset of the data appearing on the INFO page. This data does change
as the objects collect statistics over time. See SolrAdminStats
INFO
Displays a page that displays data in these Catagories:

CORE
CACHE
QUERY handlers
UPDATE handlers
OTHER

The above are links to locations on the same page. The information on the INFO
page does not change after startup.
DISTRIBUTION
If you are looking at a Master instance, each row displays the name of the slave
and the snapshots it has retrieved. If you are looking at a Slave instance, it will
display one line showing the name of its last attempt to retrieve a snapshot off its
master. See also CollectionDistribution.
PING
If successful, HTTP 200 is returned to browser but nothing is displayed. If unsuc-
cessful, HTTP 500 (an error) is returned and an exception message displayed.
LOGGING
Displays the Log Level page that allows you to set these levels:

ALL
CONFIG
FINE
FINER
FINEST
INFO
OFF
SEVERE
WARNING

Each invokes an action.jsp which shows whether the action succeeded of failed.
If successful, the word, 'succeeded', is displayed and then you are returned to the
Admin home page. If unsuccessful, the Action page display the error until you
navigate away from it). For detailed information on Logging levels, see SUN's
page on Class Logger.
AppServer Links
App Server Link Displays
PROPERTIES Displays a JSP that contains the properties of the Java Virtual Machine (JVM).
THREAD DUMP Displays a thread dump of the appserver.
ENABLE/DISABLE
This link is only displayed if a healthcheck directive appears in the admin block
ofthe Solr config. When using load balancers it makes it easy to take a server
in/out of rotation by making a healthcheck succeed/fail
Make a Query Links
Make a Query
Link
Description
FULL INTER-
FACE
To make a more customized query use the Full Interface page where you can
stipulate the following: a full Solr/Lucene Statement, Protocol Version, Start
Row, Maximum Rows Returned, Query Type, and Style Sheet.
Full Interface Pa-
rameters Page
Solr/Lucene
Statement
Use this field to a query in Lucene's query language. For detailed information
on Lucene see Apache's Lucene page.
Protocol Version
The format version that is used to return responses. Defaults to the latest, cur-
rently 2.1
Start Row Zero based offset of matching documents to return
Maximum Rows Maximum number of documents to return
Query Type Selects the query handler for this request. Default is *standard*.
Style Sheet
The Style Sheet determines the look of the Search Results.
:TODO: where can stylesheets be installed?

You might also like