Skip to content

Commit 54bc7c3

Browse files
authored
Merge pull request #138 from nathanlcarlson/commit_removal
Commit removal
2 parents 4f6e241 + c2d047c commit 54bc7c3

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/java/main/esg/search/publish/impl/solr/SolrClient.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public SolrClient(final URL url) {
6767
* Method to index a single XML record.
6868
* @param xml.
6969
* @param type : chosen among the supported record types.
70-
* @param commit : true to commit the transaction after indexing this record, false if other records are coming.
70+
* @param commit : This parameter has no effect
7171
* @return
7272
* @throws Exception
7373
*/
@@ -83,7 +83,11 @@ public String index(final String xml, final String type, boolean commit) throws
8383
String response = httpClient.doPost(postUrl, xml, true);
8484

8585
// commit changes, do not optimize for a single record
86-
if (commit) this.commit();
86+
// This results in a high frequency of commits
87+
// Which puts non-negligable load on Solr instances
88+
// Future work would be to make this externally configurable
89+
// For now, Solr "autoCommit" features will be used to perform commits
90+
// if (commit) this.commit();
8791

8892
return response;
8993

@@ -133,7 +137,8 @@ public String delete(List<String> ids, Collection<String> cores) throws Exceptio
133137
}
134138

135139
// commit changes to all cores
136-
commit();
140+
// Solr "autoCommit" features will be used to perform commits
141+
// commit();
137142

138143
return sb.toString();
139144

src/java/main/esg/search/publish/impl/solr/SolrIndexer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ public void consume(final Collection<Record> records) throws Exception {
9393
}
9494

9595
// commit all records at once, to all cores
96-
solrClient.commit();
96+
// Solr "autoCommit" features will be used to perform commits
97+
// solrClient.commit();
9798

9899
}
99100

0 commit comments

Comments
 (0)