I just noticed that <autoSoftCommit> does not have a <openSearcher> option as
<autoCommit> does. Instead, auto soft commit uses the setting of
autoCommit/openSearcher. Is this by design or a bug? It seems a bit odd. Is
there a reason why a autoSoftCommit should not have its own boolean for whether
to reopen the index searcher on commit (hard or soft.) It makes it cumbersome
to enable autoSoftCommit if autoCommit is not otherwise being used.
The example solrconfig.xml suggests that autoSoftCommit has the same settings
as autoCommit: “softAutoCommit is like autoCommit”. No hint of this difference
concerning <openSearcher>.
Some relevant code:
solrconfig.xml:
protected UpdateHandlerInfo loadUpdatehandlerInfo() {
return new UpdateHandlerInfo(get("updateHandler/@class",null),
getInt("updateHandler/autoCommit/maxDocs",-1),
getInt("updateHandler/autoCommit/maxTime",-1),
getBool("updateHandler/autoCommit/openSearcher",true),
getInt("updateHandler/commitIntervalLowerBound",-1),
getInt("updateHandler/autoSoftCommit/maxDocs",-1),
getInt("updateHandler/autoSoftCommit/maxTime",-1),
getBool("updateHandler/commitWithin/softCommit",true));
}
public UpdateHandlerInfo(String className, int autoCommmitMaxDocs, int
autoCommmitMaxTime, boolean openSearcher, int commitIntervalLowerBound,
int autoSoftCommmitMaxDocs, int autoSoftCommmitMaxTime, boolean
commitWithinSoftCommit) {
this.className = className;
this.autoCommmitMaxDocs = autoCommmitMaxDocs;
this.autoCommmitMaxTime = autoCommmitMaxTime;
this.openSearcher = openSearcher;
this.commitIntervalLowerBound = commitIntervalLowerBound;
this.autoSoftCommmitMaxDocs = autoSoftCommmitMaxDocs;
this.autoSoftCommmitMaxTime = autoSoftCommmitMaxTime;
this.commitWithinSoftCommit = commitWithinSoftCommit;
}
And in DirectUpdateHandler2:
int docsUpperBound = updateHandlerInfo.autoCommmitMaxDocs; //
getInt("updateHandler/autoCommit/maxDocs", -1);
int timeUpperBound = updateHandlerInfo.autoCommmitMaxTime; //
getInt("updateHandler/autoCommit/maxTime", -1);
commitTracker = new CommitTracker("Hard", core, docsUpperBound, timeUpperBound,
updateHandlerInfo.openSearcher, false);
int softCommitDocsUpperBound = updateHandlerInfo.autoSoftCommmitMaxDocs; //
getInt("updateHandler/autoSoftCommit/maxDocs", -1);
int softCommitTimeUpperBound = updateHandlerInfo.autoSoftCommmitMaxTime; //
getInt("updateHandler/autoSoftCommit/maxTime", -1);
softCommitTracker = new CommitTracker("Soft", core, softCommitDocsUpperBound,
softCommitTimeUpperBound, updateHandlerInfo.openSearcher, true);
-- Jack Krupansky