Skip to content

Commit

Permalink
Merge pull request #138 from nathanlcarlson/commit_removal
Browse files Browse the repository at this point in the history
Commit removal
  • Loading branch information
sashakames authored Sep 27, 2019
2 parents 4f6e241 + c2d047c commit 54bc7c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/java/main/esg/search/publish/impl/solr/SolrClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public SolrClient(final URL url) {
* Method to index a single XML record.
* @param xml.
* @param type : chosen among the supported record types.
* @param commit : true to commit the transaction after indexing this record, false if other records are coming.
* @param commit : This parameter has no effect
* @return
* @throws Exception
*/
Expand All @@ -83,7 +83,11 @@ public String index(final String xml, final String type, boolean commit) throws
String response = httpClient.doPost(postUrl, xml, true);

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

return response;

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

// commit changes to all cores
commit();
// Solr "autoCommit" features will be used to perform commits
// commit();

return sb.toString();

Expand Down
3 changes: 2 additions & 1 deletion src/java/main/esg/search/publish/impl/solr/SolrIndexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ public void consume(final Collection<Record> records) throws Exception {
}

// commit all records at once, to all cores
solrClient.commit();
// Solr "autoCommit" features will be used to perform commits
// solrClient.commit();

}

Expand Down

0 comments on commit 54bc7c3

Please sign in to comment.