shell> cd /opt/src
shell> wget "http://apache.mirror.phpchina.com/lucene/solr/1.3.0/apache-solr-1.3.0.tgz"
shell> tar xzvf apache-solr-1.3.0.tgz
shell> cd /opt/src/apache-solr-1.3.0
这样就解开了压缩包并备用状态, 里面有个jetty的 WEB Server, 与solr结合的较好,可以马上就开始。 下面是从 apache solr wiki的站点cp的 get started内容,贴在这里备查参考(http://lucene.apache.org/solr /tutorial.html#Getting+Started):
Overview
This document covers the basics of running Solr using an example schema, and some sample data.
Requirements
To follow along with this tutorial, you will need...
1.Java 1.5 or greater. Some places you can get it are from Sun, IBM, or BEA.
Running java -version at the command line should indicate a version number starting with 1.5.
2.A Solr release.
3.FireFox or Mozilla is the preferred browser to view the admin pages, as the current stylesheet doesn't look good on Internet Explorer.
Getting Started
Please run the browser showing this tutorial and the Solr server on the same machine so tutorial links will correctly point to your Solr server.
Begin by unziping the Solr release and changing your working directory to be the "example" directory. (Note that the base directory name may vary with the version of Solr downloaded.)
chrish@asimov:~solr$ ls
solr-nightly.zip
chrish@asimov:~solr$ unzip -q solr-nightly.zip
chrish@asimov:~solr$ cd solr-nightly/example/
Solr can run in any Java Servlet Container of your choice, but to simplify this tutorial, the example index includes a small installation of Jetty. In order to compile JSPs, this version of Jetty requires that you run "java" from a JDK, not from a JRE.
To launch Jetty with the Solr WAR, and the example configs, just run the start.jar ...
chrish@asimov:~/solr/example$ java -jar start.jar
1 [main] INFO org.mortbay.log - Logging to org.slf4j.impl.SimpleLogger@1f436f5 via org.mortbay.log.Slf4jLog
334 [main] INFO org.mortbay.log - Extract jar:file:/home/chrish/solr/example/webapps/solr.war!/ to /tmp/Jetty__solr/webapp
Feb 24, 2006 5:54:52 PM org.apache.solr.servlet.SolrServlet init
INFO: user.dir=/home/chrish/solr/example
Feb 24, 2006 5:54:52 PM org.apache.solr.core.SolrConfig
INFO: Loaded Config solrconfig.xml
...
1656 [main] INFO org.mortbay.log - Started SelectChannelConnector @ 0.0.0.0:8983
This will start up the Jetty application server on port 8983, and use your terminal to display the logging information from Solr.
You can see that the Solr is running by loading http://localhost:8983/solr/admin/ in your web browser. This is the main starting point for Administering Solr.
Indexing Data
Your Solr server is up and running, but it doesn't contain any data. You can modify a Solr index by POSTing XML Documents containing instructions to add (or update) documents, delete documents, commit pending adds and deletes, and optimize your index.
The exampledocs directory contains samples of the types of instructions Solr expects, as well as a java utility for posting them from the command line (a post.sh shell script is also available, but for this tutorial we'll use the cross-platform Java client).
To try this, open a new terminal window, enter the exampledocs directory, and run "java -jar post.jar" on some of the XML files in that directory, indicating the URL of the Solr server:
chrish@asimov:~/solr/example/exampledocs$ java -jar post.jar solr.xml monitor.xml
SimplePostTool: version 1.2 ..