There is no direct Solr configuration option to disable commit requests that I know of.

Maybe you could do it with an update processor. The ProcessAdd method is called to process a document; it is passed an AddUpdateCommand object for a single document and has a field for the commitWithin setting. I don't see a public method for zapping commitWithin, but I didn't look too deeply. Worst case, you would need to substitute your own equivalent of RunUpdateProcessorFactory that ignores the commitWithin setting on ProcessAdd; maybe you could subclass and extend the existing class, or maybe you would have to copy and edit it.

Also, note that the delete command also has a commitWithin setting.

-- Jack Krupansky

-----Original Message----- From: Furkan KAMACI
Sent: Thursday, May 22, 2014 6:36 AM
To: solr-user@lucene.apache.org
Subject: How to Disable Commit Option and Just Manage it via SolrConfig?

Hi All;

I've designed a system that allows people to use a search service from
SolrCloud. However I think that I should disable "commit" option for people
to avoid performance issues (many users can send commit requests and this
may cause to performance issues). I'll configure solr config file with
autocommit and I'll not let people to commit individually.

I've done some implementation for it and people can not send commit request
by GET as like:

localhost:8983/solr/update*?commit=true*

and they can not use:

HttpSolrServer solrServer = new HttpSolrServer("http://localhost:8983/solr
");
solrServer*.commit();*

I think that there is another way to send a commit request to Solr. It is
something like:

{"add":{ "doc":{"id":"change.me","title":"change.me
"},"boost":1.0,"overwrite":true,"*commitWithin*":1000}}

So, I want to stop that usage and my current implementation does not
provide it.

My question is that: Is there anyway I can close the commit option for Solr
from "clients"/"outside the world of Solr" and manage that option only via
solr config?

Thanks;
Furkan KAMACI

Reply via email to