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 Manupriya <ma...@gmail.com> on 2009/01/16 11:47:29 UTC

How to open a new searcher and close the old one

Hi,

We are using Solr as a standalone server. And our web application sends a
HTTP request for searching. We receive JSON result back and use the result.

I had initailly asked about Searher
(http://www.nabble.com/What-do-we-mean-by-Searcher--td21436737.html). Now I
understand it better. 

As per my understanding, when I send a search query for the first time, a
new searcher is opened. And this searcher caters to subsequent requests as
well. When I stop the Solr server, the current searcher stops/closes with
it. So on restarting, a new searcher will be initialized.

Now, I want to know , how can I close a current searcher and open a new
searcher through HTTP request only? I donot want to restart the server to
open a new searcher.

We would be implementing caching for our application. And I read that in
Solr, cached objects will be valid as long as the Searcher is valid. So in
order to properly manage cache, we would want to understand if there is any
way that we can close/open searcher through HTTP requests.

Thanks,
Manu


-- 
View this message in context: http://www.nabble.com/How-to-open-a-new-searcher-and-close-the-old-one-tp21496803p21496803.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: How to open a new searcher and close the old one

Posted by Alexander Ramos Jardim <al...@gmail.com>.
No,

You can't assume that. You have to set a good autoCommit value for your
solrconfig.xml, so you don't run out of memory for no commiting to Solr
often, depending on your enviroment, memory share, doc size and update
frequency.

2009/1/16 Manupriya <ma...@gmail.com>

>
> Thanks for the information!!
>
> So can I safely assume that we will not face any memory issue due to
> caching
> even if we do not send commit that frequently? (If we wont send commit,
> then
> new searcher wont be initialized. So I can assume that the current searcher
> will correctly manage cache without any memory issues.)
>
> Thanks,
> Manu
> --
> View this message in context:
> http://www.nabble.com/How-to-open-a-new-searcher-and-close-the-old-one-by-sending-HTTP-request-tp21496803p21499810.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>


-- 
Alexander Ramos Jardim

Re: How to open a new searcher and close the old one

Posted by Manupriya <ma...@gmail.com>.
Thanks for the information!!

So can I safely assume that we will not face any memory issue due to caching
even if we do not send commit that frequently? (If we wont send commit, then
new searcher wont be initialized. So I can assume that the current searcher
will correctly manage cache without any memory issues.)

Thanks,
Manu
-- 
View this message in context: http://www.nabble.com/How-to-open-a-new-searcher-and-close-the-old-one-by-sending-HTTP-request-tp21496803p21499810.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: How to open a new searcher and close the old one

Posted by Alexander Ramos Jardim <al...@gmail.com>.
Shalin is right about cache management, but fot the sake of knowledge,
everytime you sendd a commit to Solr, it will close the old Searcher and
open a new one.

2009/1/16 Shalin Shekhar Mangar <sh...@gmail.com>

> On Fri, Jan 16, 2009 at 4:17 PM, Manupriya <manupriya.sinha@gmail.com
> >wrote:
>
> >
> > Hi,
> >
> > We are using Solr as a standalone server. And our web application sends a
> > HTTP request for searching. We receive JSON result back and use the
> result.
> >
> > I had initailly asked about Searher
> > (http://www.nabble.com/What-do-we-mean-by-Searcher--td21436737.html).
> Now
> > I
> > understand it better.
> >
> > As per my understanding, when I send a search query for the first time, a
> > new searcher is opened. And this searcher caters to subsequent requests
> as
> > well. When I stop the Solr server, the current searcher stops/closes with
> > it. So on restarting, a new searcher will be initialized.
>
>
> The first searcher is opened on startup.
>
>
> > Now, I want to know , how can I close a current searcher and open a new
> > searcher through HTTP request only? I donot want to restart the server to
> > open a new searcher.
>
>
> Why do you need to do that?
>
>
> > We would be implementing caching for our application. And I read that in
> > Solr, cached objects will be valid as long as the Searcher is valid. So
> in
> > order to properly manage cache, we would want to understand if there is
> any
> > way that we can close/open searcher through HTTP requests.
>
>
> Solr automatically manages the cache correctly. Whenever a new commit
> happens on the index, a new searcher is created, warmed up and then it
> replaces the active searcher. All new requests then go to the new searcher.
> The old searcher is closed after it has finished handling all the previous
> requests which had been directed to it.
>
> The cache in Solr will never be stale. So you do not need to worry about
> these things.
>
>
> >
> >
> > Thanks,
> > Manu
> >
> >
> > --
> > View this message in context:
> >
> http://www.nabble.com/How-to-open-a-new-searcher-and-close-the-old-one-tp21496803p21496803.html
> > Sent from the Solr - User mailing list archive at Nabble.com.
> >
> >
>
>
> --
> Regards,
> Shalin Shekhar Mangar.
>



-- 
Alexander Ramos Jardim

Re: How to open a new searcher and close the old one

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
On Fri, Jan 16, 2009 at 4:17 PM, Manupriya <ma...@gmail.com>wrote:

>
> Hi,
>
> We are using Solr as a standalone server. And our web application sends a
> HTTP request for searching. We receive JSON result back and use the result.
>
> I had initailly asked about Searher
> (http://www.nabble.com/What-do-we-mean-by-Searcher--td21436737.html). Now
> I
> understand it better.
>
> As per my understanding, when I send a search query for the first time, a
> new searcher is opened. And this searcher caters to subsequent requests as
> well. When I stop the Solr server, the current searcher stops/closes with
> it. So on restarting, a new searcher will be initialized.


The first searcher is opened on startup.


> Now, I want to know , how can I close a current searcher and open a new
> searcher through HTTP request only? I donot want to restart the server to
> open a new searcher.


Why do you need to do that?


> We would be implementing caching for our application. And I read that in
> Solr, cached objects will be valid as long as the Searcher is valid. So in
> order to properly manage cache, we would want to understand if there is any
> way that we can close/open searcher through HTTP requests.


Solr automatically manages the cache correctly. Whenever a new commit
happens on the index, a new searcher is created, warmed up and then it
replaces the active searcher. All new requests then go to the new searcher.
The old searcher is closed after it has finished handling all the previous
requests which had been directed to it.

The cache in Solr will never be stale. So you do not need to worry about
these things.


>
>
> Thanks,
> Manu
>
>
> --
> View this message in context:
> http://www.nabble.com/How-to-open-a-new-searcher-and-close-the-old-one-tp21496803p21496803.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
>


-- 
Regards,
Shalin Shekhar Mangar.