File tree Expand file tree Collapse file tree 4 files changed +12
-6
lines changed
java/org/icatproject/lucene Expand file tree Collapse file tree 4 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 22# are marked with '!'
33
44directory = ${HOME}/data/search
5- commitSeconds = 5
5+ # A value of 0 will disable automatic commits and rely on icat.server to explicitly call commit after creating new documents
6+ commitSeconds = 0
67# Lucene limits the max number of documents in an index to Integer.MAX_VALUE - 128
78maxShardSize = 2147483519
89ip = 127.0.0.1/32
Original file line number Diff line number Diff line change @@ -1061,7 +1061,7 @@ private void init() {
10611061 throw new Exception (luceneDirectory + " is not a directory" );
10621062 }
10631063
1064- commitSeconds = props .getPositiveInt ("commitSeconds" );
1064+ commitSeconds = props .getNonNegativeInt ("commitSeconds" );
10651065 luceneCommitMillis = commitSeconds * 1000 ;
10661066 luceneMaxShardSize = Math .min (props .getPositiveLong ("maxShardSize" ), Long .valueOf (Integer .MAX_VALUE - 128 ));
10671067 maxSearchTimeSeconds = props .has ("maxSearchTimeSeconds" ) ? props .getPositiveLong ("maxSearchTimeSeconds" )
@@ -1092,8 +1092,10 @@ private void init() {
10921092 * Starts a timer and schedules regular commits of the IndexWriter.
10931093 */
10941094 private void initTimer () {
1095- timer = new Timer ("LuceneCommitTimer" );
1096- timer .schedule (new CommitTimerTask (), luceneCommitMillis , luceneCommitMillis );
1095+ if (luceneCommitMillis > 0 ) {
1096+ timer = new Timer ("LuceneCommitTimer" );
1097+ timer .schedule (new CommitTimerTask (), luceneCommitMillis , luceneCommitMillis );
1098+ }
10971099 }
10981100
10991101 class CommitTimerTask extends TimerTask {
Original file line number Diff line number Diff line change 22# are marked with '!'
33
44directory = ${HOME}/data/search
5- commitSeconds = 5
5+ # A value of 0 will disable automatic commits and rely on icat.server to explicitly call commit after creating new documents
6+ commitSeconds = 0
67maxShardSize = 2147483519
78ip = 127.0.0.1/32
89# A search taking longer than this will be cancelled to avoid blocking other users' searches
Original file line number Diff line number Diff line change 5454
5555 <dt>commitSeconds</dt>
5656 <dd>the interval in seconds between committing lucene changes to
57- disk and updating the index.</dd>
57+ disk and updating the index. Automatic commits can be disabled by setting to
58+ 0, in which case icat.server will need to explicitly commit after creating a
59+ batch of documents.</dd>
5860
5961 <dt>maxShardSize</dt>
6062 <dd>The maximum number of documents to store in a single index before "sharding"
You can’t perform that action at this time.
0 commit comments