[SOLR 4.1] Rapid Start Guide


Following is a very basic Rapid Start Guide to get on with the new SOLR 4.1:

1. As you know the first step is to download the zip http://lucene.apache.org/solr/

2. Unzip to a folder. you get a folder like solr-4.1.0.

3. Go to example folder and you will find start.jar.

4. Open a command prompt and go the above example folder and type “java -jar start.jar” and your solr server is up and running at default port 8983.

5. Access your server by just typing localhost:8683/solr into a browser window. The solr query URL in 4.1 is a bit changed and is now with collections: http://localhost:8983/solr/collection1/select?q=*:*

TIPS & TRICKS:

— To change the default port 8986 to some other port you have to edit the jetty.xml file example/etc folder and change the jetty.port to any other that you want and restart the server.

—To index a whole table from a database into SOLR use DataImportHandler (DIH) and do a full data import from the table to SOLR server using the following URL:

http://localhost:8983/solr/collection1/dataimport?command=full=import

—To access SOLR server in Java use Solrj, library file which is present inside solr-4.1.0/dist/ . the library is named “solr-solrj-4.1.0.jar” there are various dependencies to this jar which can be found in  solr-4.1.0/dist/solrj-lib/ folder.

—To delete all documents/indexes in the solr server use the following URL:

http://localhost:8983/solr/collection1/update?stream.body=<delete><query>*:*</query></delete&gt;

[NOTE: use the above url carefully deletes all documents and indexes from server instead use inside <query> tag something like id:1020 to delete only the document with particular id]

Further Reading:

http://lucene.apache.org/solr/

https://wiki.apache.org/solr/Solrj

http://wiki.apache.org/solr/DataImportHandler

Advertisements

About Dominic

J for JAVA more about me : http://about.me/dominicdsouza
This entry was posted in Thechy Stuff. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s