lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Rosenthal (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SOLR-2664) Disable/enable autocommit on the fly
Date Tue, 23 Aug 2011 19:40:28 GMT

    [ https://issues.apache.org/jira/browse/SOLR-2664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13089690#comment-13089690
] 

Simon Rosenthal commented on SOLR-2664:
---------------------------------------

In working on extending the functionality to SolrJ/CSV/JSON, I've seen some shortcomings and
ambiguities in the initial API I was working on.

here's a clearer approach:

The anticipated use case would be to disable autocommits temporarily during update processing
from a content stream (or from a server.add() in solrJ). So for /update handlers where a content
stream is specified, append the parameter &deferAutoCommit=true to the URL. Autocommits
will be disabled while the content stream is processed, and automatically re-enabled at the
end of processing (regardless of success or failure). This will also be a recognized attribute
in an <add> element for solr XML processing.

Additionally, no content stream is specified,  one can specify the single operations /update?disableAutoCommit=true
and subsequently /update/enableAutoCommit=true, in the same way as you can specify commit
as the only parameter. However  you're on your own if you do the one without the other....

SolrJ will have new server#disableAutoCommit and server#enableAutocommit methods, and also
 add(doc, boolean deferAutoCommit).








> Disable/enable autocommit on the fly
> ------------------------------------
>
>                 Key: SOLR-2664
>                 URL: https://issues.apache.org/jira/browse/SOLR-2664
>             Project: Solr
>          Issue Type: New Feature
>          Components: update
>    Affects Versions: 4.0
>            Reporter: Simon Rosenthal
>            Priority: Minor
>             Fix For: 4.0
>
>         Attachments: SOLR-2664.patch
>
>
> There are occasions when although autocommit is configured, it would be desirable to
disable it temporarily - for instance when batch adding/updating a set of documents which
should be committed atomically (e.g. a set of price changes).
> The patch adds <disableAutoCommit/> and </enableAutoCommit> commands to XMLUpdateHandler,
and also adds a disableAutoCommit=true|false attribute to the <add> element - this will
disable autocommit until the terminating </add> at the end of the XML document is reached.
> At present, the autocommit state will not survive a core reload.
> It should be possible to extend this functionality to SolrJ, CSVUpdatehandler ( and JSONUpdateHandler
?)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message