You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Furkan KAMACI <fu...@gmail.com> on 2014/05/22 12:36:29 UTC

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

Re: How to Disable Commit Option and Just Manage it via SolrConfig?

Posted by Furkan KAMACI <fu...@gmail.com>.
Hi Michael;

I've written an API that users send their request. I resend their queries
into Solr and manage which collection is theirs and drop query parameters
about commit. However users can send commitWithin option within their
request data and I have to analyze the data inside request to disallow it.
That's why I'm looking a solution for it within Solr without customizing it.

Thanks;
Furkan KAMACI


2014-05-22 22:16 GMT+03:00 Michael Della Bitta <
michael.della.bitta@appinions.com>:

> Just a thought: If your users can send updates and you can't trust them,
> how can you keep them from deleting all your data?
>
> I would consider using a servlet filter to inspect the request. That would
> probably be non-trivial if you plan to accept javabin requests as well.
>
> Michael Della Bitta
>
> Applications Developer
>
> o: +1 646 532 3062
>
> appinions inc.
>
> “The Science of Influence Marketing”
>
> 18 East 41st Street
>
> New York, NY 10017
>
> t: @appinions <https://twitter.com/Appinions> | g+:
> plus.google.com/appinions<
> https://plus.google.com/u/0/b/112002776285509593336/112002776285509593336/posts
> >
> w: appinions.com <http://www.appinions.com/>
>
>
> On Thu, May 22, 2014 at 6:36 AM, Furkan KAMACI <furkankamaci@gmail.com
> >wrote:
>
> > 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
> >
>

Re: How to Disable Commit Option and Just Manage it via SolrConfig?

Posted by Michael Della Bitta <mi...@appinions.com>.
Just a thought: If your users can send updates and you can't trust them,
how can you keep them from deleting all your data?

I would consider using a servlet filter to inspect the request. That would
probably be non-trivial if you plan to accept javabin requests as well.

Michael Della Bitta

Applications Developer

o: +1 646 532 3062

appinions inc.

“The Science of Influence Marketing”

18 East 41st Street

New York, NY 10017

t: @appinions <https://twitter.com/Appinions> | g+:
plus.google.com/appinions<https://plus.google.com/u/0/b/112002776285509593336/112002776285509593336/posts>
w: appinions.com <http://www.appinions.com/>


On Thu, May 22, 2014 at 6:36 AM, Furkan KAMACI <fu...@gmail.com>wrote:

> 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
>

Re: How to Disable Commit Option and Just Manage it via SolrConfig?

Posted by Jack Krupansky <ja...@basetechnology.com>.
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