You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by jitender ahuja <aj...@aalayance.com> on 2004/07/28 11:35:46 UTC

continous index update

Hi all,
          I am trying to make an automatic index update file based o a background thread, but it gives errors in deleting the existing index, if (only if) the server accesses the index at the same time or has once accessed it and even if a different request is posed, i.e. for a different index directory or a different job, it makes no difference.
Can anyone tell that in such a continous update scenario, how the old index can be updated as I feel deletion is a must of the earlier contents so as to get the new contents in place.

Regards,
Jitender

Re: continous index update

Posted by Sergiu Gordea <gs...@ifit.uni-klu.ac.at>.
you have to delete the documents using IndexReader and write the 
Documents using IndexWriter,
both of them place a lock on the index file, so ... you cannot work with 
both of them in the same time.
(you get errors when you have an opened IndexWriter and try to delete a 
document with an IndexWriter).

  I'm using lucene to index information I have in a database. Each time 
the records in database are modified, I delete
the document and I add it again. If you are working with threads, make 
sure that the instantiation and closing of IndexWriter and
IndexReaders are made in synchronized code.

 All the best,

  Sergiu


 
jitender ahuja wrote:

>Hi,
>      I am working on Windows platform and I think it wouldn't work there.
>If it can, do please tell me.
>
>Regards,
>Jitender
>----- Original Message ----- 
>From: "Vladimir Yuryev" <vy...@rambler.ru>
>To: "Lucene Users List" <lu...@jakarta.apache.org>
>Sent: Wednesday, July 28, 2004 3:17 PM
>Subject: Re: continous index update
>
>
>  
>
>>Hi!
>>
>>I do automatic index update by cron daemon.
>>
>>Regards,
>>Vladimir.
>>
>>On Wed, 28 Jul 2004 15:05:46 +0530
>>  "jitender ahuja" <aj...@aalayance.com> wrote:
>>    
>>
>>>Hi all,
>>>         I am trying to make an automatic index update file based o
>>>a background thread, but it gives errors in deleting the existing
>>>index, if (only if) the server accesses the index at the same time or
>>>has once accessed it and even if a different request is posed, i.e.
>>>for a different index directory or a different job, it makes no
>>>difference.
>>>Can anyone tell that in such a continous update scenario, how the old
>>>index can be updated as I feel deletion is a must of the earlier
>>>contents so as to get the new contents in place.
>>>
>>>Regards,
>>>Jitender
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>>
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: continous index update

Posted by Vladimir Yuryev <vy...@rambler.ru>.
Jitender

Use task manager.

Regards,
Vladimir.

On Wed, 28 Jul 2004 16:13:51 +0530
  "jitender ahuja" <aj...@aalayance.com> wrote:
>Hi,
>      I am working on Windows platform and I think it wouldn't work 
>there.
>If it can, do please tell me.
>
>Regards,
>
>----- Original Message ----- 
>From: "Vladimir Yuryev" <vy...@rambler.ru>
>To: "Lucene Users List" <lu...@jakarta.apache.org>
>Sent: Wednesday, July 28, 2004 3:17 PM
>Subject: Re: continous index update
>
>
>> Hi!
>>
>> I do automatic index update by cron daemon.
>>
>> Regards,
>> Vladimir.
>>
>> On Wed, 28 Jul 2004 15:05:46 +0530
>>   "jitender ahuja" <aj...@aalayance.com> wrote:
>> >Hi all,
>> >          I am trying to make an automatic index update file based 
>>o
>> >a background thread, but it gives errors in deleting the existing
>> >index, if (only if) the server accesses the index at the same time 
>>or
>> >has once accessed it and even if a different request is posed, i.e.
>> >for a different index directory or a different job, it makes no
>> >difference.
>> >Can anyone tell that in such a continous update scenario, how the 
>>old
>> >index can be updated as I feel deletion is a must of the earlier
>> >contents so as to get the new contents in place.
>> >
>> >Regards,
>> >Jitender
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>>
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: continous index update

Posted by jitender ahuja <aj...@aalayance.com>.
Hi,
      I am working on Windows platform and I think it wouldn't work there.
If it can, do please tell me.

Regards,
Jitender
----- Original Message ----- 
From: "Vladimir Yuryev" <vy...@rambler.ru>
To: "Lucene Users List" <lu...@jakarta.apache.org>
Sent: Wednesday, July 28, 2004 3:17 PM
Subject: Re: continous index update


> Hi!
>
> I do automatic index update by cron daemon.
>
> Regards,
> Vladimir.
>
> On Wed, 28 Jul 2004 15:05:46 +0530
>   "jitender ahuja" <aj...@aalayance.com> wrote:
> >Hi all,
> >          I am trying to make an automatic index update file based o
> >a background thread, but it gives errors in deleting the existing
> >index, if (only if) the server accesses the index at the same time or
> >has once accessed it and even if a different request is posed, i.e.
> >for a different index directory or a different job, it makes no
> >difference.
> >Can anyone tell that in such a continous update scenario, how the old
> >index can be updated as I feel deletion is a must of the earlier
> >contents so as to get the new contents in place.
> >
> >Regards,
> >Jitender
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: continous index update

Posted by Vladimir Yuryev <vy...@rambler.ru>.
Hi!

I do automatic index update by cron daemon.

Regards,
Vladimir.

On Wed, 28 Jul 2004 15:05:46 +0530
  "jitender ahuja" <aj...@aalayance.com> wrote:
>Hi all,
>          I am trying to make an automatic index update file based o 
>a background thread, but it gives errors in deleting the existing 
>index, if (only if) the server accesses the index at the same time or 
>has once accessed it and even if a different request is posed, i.e. 
>for a different index directory or a different job, it makes no 
>difference.
>Can anyone tell that in such a continous update scenario, how the old 
>index can be updated as I feel deletion is a must of the earlier 
>contents so as to get the new contents in place.
>
>Regards,
>Jitender


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Re: continous index update

Posted by Stephane James Vaucher <va...@cirano.qc.ca>.
I don't know if this helps, but this is what I do. I believe this is
correct, but I have just finished impl and haven't tested it fully:

-> keep referrence to valid searcher
-> open a reader on the old index
-> open a writer to a tmp Directory (RAM of FS)
-> find removed/modified files, remove from reader and add (if update, or
new document) to writer
-> close reader, open writer on master dir merge with tmp dir
-> update searcher reference

This "seems" to work while there is concurrent requests, but I need to be
more thorough.
HTH,
sv

On Wed, 28 Jul 2004, jitender ahuja wrote:

> Hi all,
>           I am trying to make an automatic index update file based o a background thread, but it gives errors in deleting the existing index, if (only if) the server accesses the index at the same time or has once accessed it and even if a different request is posed, i.e. for a different index directory or a different job, it makes no difference.
> Can anyone tell that in such a continous update scenario, how the old index can be updated as I feel deletion is a must of the earlier contents so as to get the new contents in place.
>
> Regards,
> Jitender


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org