Vladimir Vladimir - 12 days ago 5
Git Question

Shall I commit solr file?

I have added the full text search by sunspot gem and apache solr. I got many new files in my project. I don't know, is it right, but I commited this files:

solr/configsets/sunspot/conf/_rest_managed.json
solr/configsets/sunspot/conf/admin-extra.html
solr/configsets/sunspot/conf/currency.xml
solr/configsets/sunspot/conf/elevate.xml
solr/configsets/sunspot/conf/lang/stopwords_en.txt
solr/configsets/sunspot/conf/mapping-ISOLatin1Accent.txt
solr/configsets/sunspot/conf/protwords.txt
solr/configsets/sunspot/conf/schema.xml
solr/configsets/sunspot/conf/scripts.conf
solr/configsets/sunspot/conf/solrconfig.xml
solr/configsets/sunspot/conf/spellings.txt
solr/configsets/sunspot/conf/synonyms.txt
solr/default/core.properties
solr/default/data/index/segments_1
solr/default/data/index/write.lock
solr/development/core.properties
solr/development/data/index/segments_1
solr/development/data/index/write.lock
solr/pids/development/sunspot-solr-development.pid
solr/solr.xml
solr/test/core.properties
solr/test/data/index/segments_1
solr/test/data/index/write.lock


After this commit I have got files:

new file: solr/development/data/index/_1.fdt
new file: solr/development/data/index/_1.fdx
new file: solr/development/data/index/_1.fnm
new file: solr/development/data/index/_1.nvd
new file: solr/development/data/index/_1.nvm
new file: solr/development/data/index/_1.si
new file: solr/development/data/index/_1_1.liv
new file: solr/development/data/index/_1_Lucene50_0.doc
new file: solr/development/data/index/_1_Lucene50_0.pos
new file: solr/development/data/index/_1_Lucene50_0.tim
new file: solr/development/data/index/_1_Lucene50_0.tip
new file: solr/development/data/index/_2.fdt
new file: solr/development/data/index/_2.fdx
new file: solr/development/data/index/_2.fnm
new file: solr/development/data/index/_2.nvd
new file: solr/development/data/index/_2.nvm
new file: solr/development/data/index/_2.si
new file: solr/development/data/index/_2_Lucene50_0.doc
new file: solr/development/data/index/_2_Lucene50_0.pos
new file: solr/development/data/index/_2_Lucene50_0.tim
new file: solr/development/data/index/_2_Lucene50_0.tip
new file: solr/development/data/index/segments_5
new file: solr/development/data/tlog/tlog.0000000000000000000
new file: solr/development/data/tlog/tlog.0000000000000000001
new file: solr/development/data/tlog/tlog.0000000000000000002
new file: solr/development/data/tlog/tlog.0000000000000000003

Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)

modified: app/controllers/posts_controller.rb
modified: app/views/posts/index.html.erb
deleted: solr/development/data/index/_2.fdt
deleted: solr/development/data/index/_2.fdx
deleted: solr/development/data/index/_2.fnm
deleted: solr/development/data/index/_2.nvd
deleted: solr/development/data/index/_2.nvm
deleted: solr/development/data/index/_2.si
deleted: solr/development/data/index/_2_Lucene50_0.doc
deleted: solr/development/data/index/_2_Lucene50_0.pos
deleted: solr/development/data/index/_2_Lucene50_0.tim
deleted: solr/development/data/index/_2_Lucene50_0.tip
deleted: solr/development/data/index/segments_1
deleted: solr/development/data/index/segments_5

Untracked files:
(use "git add <file>..." to include in what will be committed)

solr/development/data/index/_4.fdt
solr/development/data/index/_4.fdx
solr/development/data/index/_4.fnm
solr/development/data/index/_4.nvd
solr/development/data/index/_4.nvm
solr/development/data/index/_4.si
solr/development/data/index/_4_Lucene50_0.doc
solr/development/data/index/_4_Lucene50_0.pos
solr/development/data/index/_4_Lucene50_0.tim
solr/development/data/index/_4_Lucene50_0.tip
solr/development/data/index/segments_9
solr/development/data/tlog/tlog.0000000000000000004
solr/development/data/tlog/tlog.0000000000000000005
solr/development/data/tlog/tlog.0000000000000000006
solr/development/data/tlog/tlog.0000000000000000007


What files I need commit, add .gitignore, add to my projects?

Answer

git ignore:

*/data/*
*/dataimport.properties


For example:

 solr/development/data/*
 solr/development/conf/dataimport.properties

dataimport.proporties contains last indexed time and other dynamic variables

#Thu Nov 17 16:21:03 GMT 2016
last_index_time=2016-11-17 16\:21\:03
development.last_index_time=2016-11-17 16\:21\:03

solr/development/data/ - full indexed core with cache filters.

Commit:

All other files are happy to be committed.

solr/development/conf/ - main core settings (schema.xml, solrconfig.xml etc)