,

Apache Solr 4 – Getting Started

Download Server


# set version and base directory
version="4.4.0"
basedir=~/build/solr

# create directory for Solr server binaries
mkdir $basedir
cd $basedir

# download solr binaries > 70 MB
wget http://apache.mirror.clusters.cc/lucene/solr/$version/solr-$version.zip

# extract zip file
unzip -oq solr-$version.zip

# move versioned directory
mv solr-$version solr

Start Server


# set base directory
basedir=~/build/solr
cd $basedir/solr/example/

# start solr server - uses port localhost:8983
java -jar start.jar

Index Files


# set base directory
basedir=~/build/solr

# index xml files using post.jar
cd $basedir/solr/example/exampledocs
java -jar post.jar *.xml

Review Indexed Data

Go to Solr GUI: http://localhost:8983/solr/#/collection1/query?q=%2Bvideo%20%2Bprice%3A[*%20TO%20400]

References

1. http://lucene.apache.org/solr/
2. http://lucene.apache.org/solr/4_1_0/