简体   繁体   中英

Solr and java project version control

I have maven project and i have recently introduced Solr to act as a search indexer for my data. Solr contains configuration files such as schema.xml or solr.xml etc, but these files sit within solr package. I would like to add these files to version control (SVN) of my project. but i dont want the entire solr in my SVN just the configuration files.

What would be the correct way of managing this? I don't want to just simply add these files, and each time when i check out the code paste those files in solr, too many release steps...

Ideally i would want solr configuration to link to my files automatically so i can change them at any time, and each time i update the changes to SVN, solr would pull the new configs without me having to interfere.

Any suggestions appreciated.

The best way I've found is to create a solr-conf directory at the top-level of your project structure, containing all of your Solr config:

- project - solr-conf solr.xml - collection1 - conf

You then run Solr using your solr-conf directory as SOLR_HOME. You will need to either set your Solr dataDir property to something outside your directory tree, or add collection1/data to the svn:ignore list.

To change the data directory, you should be able to add -Dsolr.data.dir=/data/path to your Solr command line (the actual property used is specified in the dataDir element in solrconfig.xml). Alternatively, svn:ignore specifies a set of paths that should not be added to version control.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM