Yonik Seeley wrote: > This explains some of it: > http://wiki.apache.org/solr/SolrCaching > > So, there is normally only a single searcher handing around. > When a new searcher is opened, it is opened and warmed in the > "background" so there are two searchers for the duration of warming. > > A new searcher is only opened on an explicit <commit> command... Solr > does not attempt to detect when an index has changed (doing so could > result in inconsistencies, and worse performance). > > If explicit commits are done fast enough, and warming takes long > enough, one can get into the situation where there are multiple > searchers warming in the background at the same time. We currently > hande this by ensuring clients behave.
That all looks excellent. Obviously the <commit> is aimed at sensible batching of index updates. In our case index updates can't be batched and are done immediately a news item hits the system. However if I understand the above properly, we should implement a strategy which at least limits the commit frequency, to prevent the scenario you describe in the last para above. Cheers, Paul. > -Yonik > > On 10/23/06, Paul Waite <[EMAIL PROTECTED]> wrote: > > Hi chaps, > > > > I currently have a lucene app. which is a daemon listening on a port for > > XML requests and servicing these. I'm intending to switch to using Solr in > > the near(ish) future, but have a question. > > > > In my daemon, for servicing incoming search requests I manage index > > Searchers in a cache via the following cases:. > > > > 1) there's is no cached Searcher: > > - create a new Searcher and cache it > > > > 2) there is a cached Searcher, and index has NOT been updated since it > > was created: > > - use cached Searcher. > > > > 3) there is a cached Searcher, and index HAS been updated since it > > was created: > > - if the cache limit is not reached flag current Searcher as "old", > > create new Searcher and cache it, else if cache limit reached return > > current Searcher. > > > > Searchers flagged as "old" get retired as soon as they finish servicing any > > existing requests. > > > > > > The question I have regarding Solr is: does it do something similar? If > > so can someone please describe the process - thanks. > > > > I am particularly interested in a provision for a cap on creation of new > > Searchers, as described in (3) above. As my index has grown, and the system > > updates it frequently, I found that an open-ended approach to creation of > > new Searchers in the event of index change was leading to out-of-memory > > errors. > > > > Cheers, > > Paul. > -- Extract from Official Sweepstakes Rules: NO PURCHASE REQUIRED TO CLAIM YOUR PRIZE To claim your prize without purchase, do the following: (a) Carefully cut out your computer-printed name and address from upper right hand corner of the Prize Claim Form. (b) Affix computer-printed name and address -- with glue or cellophane tape (no staples or paper clips) -- to a 3x5 inch index card. (c) Also cut out the "No" paragraph (lower left hand corner of Prize Claim Form) and affix it to the 3x5 card below your address label. (d) Then print on your 3x5 card, above your computer-printed name and address the words "CARTER & VAN PEEL SWEEPSTAKES" (Use all capital letters.) (e) Finally place 3x5 card (without bending) into a plain envelope [NOTE: do NOT use the the Official Prize Claim and CVP Perfume Reply Envelope or you may be disqualified], and mail to: CVP, Box 1320, Westbury, NY 11595. Print this address correctly. Comply with above instructions carefully and completely or you may be disqualified from receiving your prize.