You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2011/09/09 00:30:22 UTC

[Solr Wiki] Trivial Update of "CommitWithin" by JanHoydahl

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "CommitWithin" page has been changed by JanHoydahl:
http://wiki.apache.org/solr/CommitWithin?action=diff&rev1=1&rev2=2

  There are multiple commit strategies in Solr. The most known is explicit <commit>s from the client. Then you have AutoCommit, configured in solrconfig.xml, which lets Solr automatically commit <add>s after a certain time or number of documents, and finally there may be a behind-the-scenes commit when the input buffer gets full.
  
  == What is it ==
- '''CommitWithin''' is a commit strategy introduced in Solr 1.4, which lets the client ask Solr to make sure this <add> gets committed within a certain time. This leaves the control of when to do the commit to Solr itself, minimizing number of commits to a minimum while still trying to fulfill the update latency requirements. If I say <add commitWithin=10000> (in an XMLUpdateRequestHandler update), that tells Solr to make sure the document gets committed within 10000ms, i.e. 10s. I can then continue to add other documents within those 10 seconds (possibly with other commitWithin values), and Solr will automatically do a <commit> when the oldest <add> batch in the buffer gets due.
+ '''CommitWithin''' is a commit strategy introduced in Solr 1.4, which lets the client ask Solr to make sure this <add> gets committed within a certain time. This leaves the control of when to do the commit to Solr itself, optimizing number of commits to a minimum while still fulfilling the update latency requirements. If I say <add commitWithin=10000> (in an XMLUpdateRequestHandler update), that tells Solr to make sure the document gets committed within 10000ms, i.e. 10s. I can then continue to add other documents within those 10 seconds (possibly with other commitWithin values), and Solr will automatically do a <commit> when the oldest <add> in the buffer is due.
  
  == Ways to do commitWithin ==
  There are multiple ways to convey the commitWithin information to Solr.
@@ -19, +19 @@

      UpdateRequest req = new UpdateRequest();
      req.add(mySolrInputDocument);
      req.setCommitWithin(10000);
-     req.process(this);
+     req.process(server);
  }}}
  
  === Update Request parameter ===