You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Maxim Patramanskij <ma...@osua.de> on 2006/02/23 08:42:56 UTC
Re[2]: RE : DateFilter.Before/After
Hello Erik,
Monday, September 15, 2003, 4:27:27 PM, you wrote:
EH> On Monday, September 15, 2003, at 09:45 AM, Bruce Ritchie wrote:
>> I would suggest *not* using caching inside of filters provided by
>> lucene but rather provide a wrapper to do the caching. The reason is
>> that some applications really don't want the libraries they use to be
>> a source of concern for memory usage. i.e. if I search for a string
>> using 10,000 different date filters (an extreme example, but possible)
>> I want the ability to control how those bitsets are going to be > cached.
EH> In the case of QueryFilter, simply construct a new one to avoid caching
EH> rather than reuse the same instance. So you have control there as
EH> well. The only thing that is cached is a BitSet, so it should be much
EH> of a memory usage concern.
>> public class CachedFilter extends Filter {
>> BitSet bits;
>> Filter filter;
>>
>> public CachedFilter(Filter filter) {
>> this.filter = filter;
>> this.bits = null;
>> }
>>
>> public BitSet bits(IndexReader reader) throws IOException {
>> if (bits != null) {
>> return bits;
>> }
>>
>> bits = filter.bits(reader);
>> return bits;
>> }
>> }
EH> You would have problems if you searched a different index or different
EH> instance of IndexReader even with your caching here. You should cache
EH> like QueryFilter does to avoid a potential mismatch with IndexReader
EH> instances.
EH> But you're implementation is exactly what I was envisioning with the
EH> added WeakHashMap of QueryFilter.
EH> Erik
EH> ---------------------------------------------------------------------
EH> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
EH> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
--
Best regards,
Maxim mailto:max@osua.de
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
RE: need help on updating index
Posted by samir <sa...@i-link.co.in>.
Hi Erik,
Thank you very much for a prompt reply
Regards
Samir
-----Original Message-----
From: Erik Hatcher [mailto:erik@ehatchersolutions.com]
Sent: 23 February 2006 13:52
To: java-dev@lucene.apache.org
Subject: Re: need help on updating index
On Feb 23, 2006, at 2:53 AM, samir wrote:
> I have one document in the index.
> If that document is only renamed but its content is same as before
> then can
> I update the index.
> As the Book Lucene in Action says that Lucene doesn't have any
> thing like
> update(...) method. And for updating one need to delete the old
> document and
> add the new document.
> Is it the only solution?
Yes, delete/add is the only solution to "update".
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
Re: need help on updating index
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Feb 23, 2006, at 2:53 AM, samir wrote:
> I have one document in the index.
> If that document is only renamed but its content is same as before
> then can
> I update the index.
> As the Book Lucene in Action says that Lucene doesn't have any
> thing like
> update(...) method. And for updating one need to delete the old
> document and
> add the new document.
> Is it the only solution?
Yes, delete/add is the only solution to "update".
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
need help on updating index
Posted by samir <sa...@i-link.co.in>.
Hello,
I have one document in the index.
If that document is only renamed but its content is same as before then can
I update the index.
As the Book Lucene in Action says that Lucene doesn't have any thing like
update(...) method. And for updating one need to delete the old document and
add the new document.
Is it the only solution?
Regards,
Samir
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org