Getting started with Tomcat and Solr

Step 1: Download HDS

Apache Solr by default ships with a Jetty based Solr server in the “example” directory, but many people prefer Tomcat.
Configuring your own Tomcat server can be daunting, as can be seen by the large list of instructions on the Solr wiki, and problems often surface later due to incorrect configuration.

HDS (Heliosearch Distribution for Solr) is a pre-configured Tomcat Solr distribution in the “server” directory. It’s a super-set of the normal Apache Solr distribution and is open source and free to use.

Step 2: Start the Tomcat based Solr server

$ cd server
$ bin/

By default, this starts up a Solr server on port 8983, the same standard Solr port that the Jetty based server in “example” uses.

Step 3: Go!

You’re now ready to start using your Tomcat based Solr server!
To verify Solr is up and running, you can point your browser at the admin page:


At this point, you should be able to treat this as any other Solr server and follow more generic tutorials or getting started guides.

More Info

The scripts can be run from anywhere, and allow passing JVM args on command line (just like jetty) to make it easier to use and to allow multiple servers to run on the same box without editing configuration files. The start scripts also work around known JVM bugs that could otherwise cause crashing or index corruption.

Stopping a server

$ cd server
$ bin/

Using a different port

$ cd server
$ bin/ -Dhttp.port=7574
$ cd server
$ bin/ -Dhttp.port=7574

Advanced Filter Caching in Solr

The filter caching features in Solr 3.4 and above allow for precise control over how Solr handles filter queries in order to maximize performance, including the ability to specify if a filter is cached, the order filters are evaluated, and post … [Continue reading]

MurmurHash3 for Java

Background I needed a really good hash function for the distributed indexing we're implementing for Solr. Since it will be used for partitioning documents, it needed to be really high quality (well distributed) since we don't want uneven shards. It … [Continue reading]

Solr’s Realtime Get

Solr took another step toward increasing it's NoSQL datastore capabilities, with the addition of realtime get. Background As readers probably know, Lucene/Solr search works off of point-in-time snapshots of the index. After changes have been made … [Continue reading]

Solr relevancy function queries

Lucene's default ranking function uses factors such as tf, idf, and norm to help calculate relevancy scores. Solr has now exposed these factors as function queries. docfreq(field,term) returns the number of documents that contain the term in the … [Continue reading]

Solr Result Grouping / Field Collapsing Improvements

I previously introduced Solr's Result Grouping, also called Field Collapsing, that limits the number of documents shown for each “group”, normally defined as the unique values in a field or function query. Since then, there have been a number of … [Continue reading]

Indexing JSON in Solr 3.1

Solr has been able to produce JSON results for a long time, by adding wt=json to any query. A new capability has recently been added to allow indexing in JSON, as well as issuing other update commands such as deletes and commits. All of the … [Continue reading]

Solr Result Grouping / Field Collapsing

Result Grouping, also called Field Collapsing, has been committed to Solr! This functionality limits the number of documents for each "group", usually defined by the unique values in a field (just like field faceting). You can think of it like … [Continue reading]

CSV output for Solr

Solr has been able to slurp in CSV for quite some time, and now I've finally got around to adding the ability to output query results in CSV also. The output format matches what the CSV loader can slurp. Adding a simple wt=csv to a query request … [Continue reading]

Ranges over Functions in Solr 1.4

Solr 1.4 contains a new feature that allows range queries or range filters over arbitrary functions.  It's implemented as a standard Solr QParser plugin, and thus easily available for use any place that accepts the standard Solr Query Syntax by … [Continue reading]