Skip to content

Commit

Permalink
Comment on removal of commits
Browse files Browse the repository at this point in the history
Solr commits are heavy operations that put a significant amount
of load on Solr instances. Solr provides "autoCommit" features
that perform commits at regular intervals or after a set number of
updates.
  • Loading branch information
nathanlcarlson committed Sep 27, 2019
1 parent 88c2d82 commit c2d047c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion 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,6 +83,10 @@ 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
// 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,6 +137,7 @@ public String delete(List<String> ids, Collection<String> cores) throws Exceptio
}

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

return sb.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public void consume(final Collection<Record> records) throws Exception {
}

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

}
Expand Down

0 comments on commit c2d047c

Please sign in to comment.