Tuesday, December 25, 2012

Solr Index File Location

HOW TO CHANGE THE INDEX FILE LOCATION OF SOLR

If you want to use your solr in a specified index folder, you should arrange a directory. For example : There is a solrconfig.xml file in the root of your solr server and you can see the related xml such as :  <dataDir>${solr.data.dir:}</dataDir> this means the directory path will be handled at the start up time of your server. This parameters default is the data directory that is in your example folder. If you want to specify a new folder you can define as server parameter. 

1 )I was using eclipse and tomcat so click twice to the server in your server tab.

2 ) Then click to Open Launch Configuration

3 ) Then click to the Arguments

4 ) Then put -Dsolr.data.dir=D:\solrIndex this if you want to store your index file at the D:\solrIndex folder. Then stop your server if it is running and then start again.

Now your index folders and index files will be created in the solrIndex folder.


After you change the home location of the solr, restart your solr.

To achieve this go to your solr home directory from command line that contains start.jar and then type java -jar start.jar. Then use it from your program if you develop web based restart your server with the configured server parameters.

No comments:

Post a Comment