Hi All,

After some study, I used below snippet. Seems the documents is updated,
while still takes a long time. Feels like the parameter does not take
effect. Any comments?
UpdateRequest req = new UpdateRequest();
            req.add(solrDocs);
            req.setCommitWithin(5000);
            req.setParam("commitWithin", "5000");
            req.setAction(AbstractUpdateRequest.ACTION.COMMIT, true, true);
            req.process(SOLR_SERVER);

2011/11/22 yu shen <shenyu...@gmail.com>

> Hi All,
>
> I try to do a 'nearly real time update' to solr.  My solr version is
> 1.4.1. I read this solr 
> CommentWithin<http://wiki.apache.org/solr/CommitWithin>wiki, and a related
> thread<http://lucene.472066.n3.nabble.com/Solr-real-time-update-taking-time-td3472709.html>mostly
>  on the difficulty to do this.
> My issue is I tried the code snippet in the wiki:
>
> UpdateRequest req = new UpdateRequest();
> req.add(mySolrInputDocument);
> req.setCommitWithin(10000);
> req.process(server);
>
> But my index did not get updated, unless I call SOLR_SERVER.commit();
> explicitly. The latter call will take more than 1 minute on average to
> return.
>
> Can I do a real time update on solr 1.4.1? Would someone help to show a
> workable code snippet?
>
> Spark
>

Reply via email to