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 anjana m <an...@gmail.com> on 2008/02/13 09:08:34 UTC
Re: Retain the index
hey i am running my indexer on application server/ production server..
i cant delete the files..
please give me a good solution..
changing true and false is not working..if have add new docs..
can nay one help me..please...
regards
anjana
On Jan 31, 2008 3:02 PM, Michael McCandless <lu...@mikemccandless.com>
wrote:
>
> Physically delete the file, or, use IndexReader.unlock static method.
>
> Mike
>
> On Jan 31, 2008, at 4:26 AM, anjana m wrote:
>
> > How do i remove the locks..?
> >
> >
> >
> > On Jan 31, 2008 2:49 PM, Michael McCandless
> > <lu...@mikemccandless.com>
> > wrote:
> >
> >>
> >> It looks like you are passing "true" to FSDirectory.getDirectory,
> >> which you shouldn't do. Always pass "false" to that. (Newer
> >> versions of Lucene have deprecated the create flag to FSDirectory,
> >> leaving it entirely to IndexWriter).
> >>
> >> On the lock obtain timed out, probably that's a left over lock file,
> >> so you should just remove it if you're sure it is.
> >>
> >> Mike
> >>
> >> anjana m wrote:
> >>
> >>> with true:
> >>> i finding a serious problem when i need new index please help..
> >>> but how can ikeep chnaging the true flase option..
> >>> :(
> >>> please help me...:(
> >>> Exception in thread "main" java.io.IOException: Cannot delete
> >>> _17.cfs
> >>> at org.apache.lucene.store.FSDirectory.create
> >>> (FSDirectory.java:144)
> >>> at org.apache.lucene.store.FSDirectory.<init>
> >>> (FSDirectory.java:128)
> >>> at org.apache.lucene.store.FSDirectory.getDirectory
> >>> (FSDirectory.java
> >>> :102)
> >>> at org.apache.lucene.index.IndexWriter.<init>
> >>> (IndexWriter.java:193)
> >>>
> >>>
> >>> False
> >>> Exception in thread "main" java.io.IOException: Lock obtain timed
> >>> out:
> >>> Lock@C:\DOCUME~1\ANJANA\LOCALS~1\Temp\lucene-
> >>> 3ca21f86af4e6d9f86b82f8f13be98e4-write.lock
> >>> at org.apache.lucene.store.Lock.obtain(Lock.java:58)
> >>> at org.apache.lucene.index.IndexWriter.<init>
> >>> (IndexWriter.java:223)
> >>> at org.apache.lucene.index.IndexWriter.<init>
> >>> (IndexWriter.java:193)
> >>> at com.cecilia.wim.process.Indexer.index(Indexer.java:25)
> >>> at com.cecilia.wim.process.Indexer.main(Indexer.java:60)
> >>>
> >>>
> >>> On Jan 28, 2008 3:22 AM, Erick Erickson <er...@gmail.com>
> >>> wrote:
> >>>
> >>>> Set the parameter to false as per the documentation....
> >>>>
> >>>> Erick
> >>>>
> >>>> On Jan 27, 2008 5:11 AM, anjana m <an...@gmail.com> wrote:
> >>>>
> >>>>> yes i dont want the old index to be deletd since its running on
> >>>>> my app
> >>>>> server..
> >>>>> any suggestion..?
> >>>>>
> >>>>> On Jan 27, 2008 3:07 PM, Daniel Naber
> >>>>> <lu...@danielnaber.de>
> >>>>> wrote:
> >>>>>
> >>>>>> On Sonntag, 27. Januar 2008, anjana m wrote:
> >>>>>>
> >>>>>>> IndexWriter writer = new IndexWriter(indexDir, new
> >>>>>>> StandardAnalyzer(), true);
> >>>>>>
> >>>>>> The true parameter means that the old index will be deleted, is
> >>>>>> that
> >>>>> your
> >>>>>> problem?
> >>>>>>
> >>>>>> Regards
> >>>>>> Daniel
> >>>>>>
> >>>>>> --
> >>>>>> http://www.danielnaber.de
> >>>>>>
> >>>>>> -----------------------------------------------------------------
> >>>>>> --
> >>>>>> --
> >>>>>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> >>>>>> For additional commands, e-mail: java-user-help@lucene.apache.org
> >>>>>>
> >>>>>>
> >>>>>
> >>>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> >> For additional commands, e-mail: java-user-help@lucene.apache.org
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
Re: Retain the index
Posted by Michael McCandless <lu...@mikemccandless.com>.
You could create your own SimpleFSLockFactory, specifying a different
lock dir, and pass that to FSDirectory.getDirectory.
This way you can control where the lock file is created and hopefully
put it in a dir that you're able to delete from.
Or, update to a newer version of Lucene, which stores the lock file
in the index directory by default.
Mike
anjana m wrote:
> hey i am running my indexer on application server/ production server..
> i cant delete the files..
> please give me a good solution..
> changing true and false is not working..if have add new docs..
> can nay one help me..please...
> regards
> anjana
>
> On Jan 31, 2008 3:02 PM, Michael McCandless
> <lu...@mikemccandless.com>
> wrote:
>
>>
>> Physically delete the file, or, use IndexReader.unlock static method.
>>
>> Mike
>>
>> On Jan 31, 2008, at 4:26 AM, anjana m wrote:
>>
>>> How do i remove the locks..?
>>>
>>>
>>>
>>> On Jan 31, 2008 2:49 PM, Michael McCandless
>>> <lu...@mikemccandless.com>
>>> wrote:
>>>
>>>>
>>>> It looks like you are passing "true" to FSDirectory.getDirectory,
>>>> which you shouldn't do. Always pass "false" to that. (Newer
>>>> versions of Lucene have deprecated the create flag to FSDirectory,
>>>> leaving it entirely to IndexWriter).
>>>>
>>>> On the lock obtain timed out, probably that's a left over lock
>>>> file,
>>>> so you should just remove it if you're sure it is.
>>>>
>>>> Mike
>>>>
>>>> anjana m wrote:
>>>>
>>>>> with true:
>>>>> i finding a serious problem when i need new index please help..
>>>>> but how can ikeep chnaging the true flase option..
>>>>> :(
>>>>> please help me...:(
>>>>> Exception in thread "main" java.io.IOException: Cannot delete
>>>>> _17.cfs
>>>>> at org.apache.lucene.store.FSDirectory.create
>>>>> (FSDirectory.java:144)
>>>>> at org.apache.lucene.store.FSDirectory.<init>
>>>>> (FSDirectory.java:128)
>>>>> at org.apache.lucene.store.FSDirectory.getDirectory
>>>>> (FSDirectory.java
>>>>> :102)
>>>>> at org.apache.lucene.index.IndexWriter.<init>
>>>>> (IndexWriter.java:193)
>>>>>
>>>>>
>>>>> False
>>>>> Exception in thread "main" java.io.IOException: Lock obtain timed
>>>>> out:
>>>>> Lock@C:\DOCUME~1\ANJANA\LOCALS~1\Temp\lucene-
>>>>> 3ca21f86af4e6d9f86b82f8f13be98e4-write.lock
>>>>> at org.apache.lucene.store.Lock.obtain(Lock.java:58)
>>>>> at org.apache.lucene.index.IndexWriter.<init>
>>>>> (IndexWriter.java:223)
>>>>> at org.apache.lucene.index.IndexWriter.<init>
>>>>> (IndexWriter.java:193)
>>>>> at com.cecilia.wim.process.Indexer.index(Indexer.java:25)
>>>>> at com.cecilia.wim.process.Indexer.main(Indexer.java:60)
>>>>>
>>>>>
>>>>> On Jan 28, 2008 3:22 AM, Erick Erickson <er...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Set the parameter to false as per the documentation....
>>>>>>
>>>>>> Erick
>>>>>>
>>>>>> On Jan 27, 2008 5:11 AM, anjana m <an...@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> yes i dont want the old index to be deletd since its running on
>>>>>>> my app
>>>>>>> server..
>>>>>>> any suggestion..?
>>>>>>>
>>>>>>> On Jan 27, 2008 3:07 PM, Daniel Naber
>>>>>>> <lu...@danielnaber.de>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> On Sonntag, 27. Januar 2008, anjana m wrote:
>>>>>>>>
>>>>>>>>> IndexWriter writer = new IndexWriter(indexDir, new
>>>>>>>>> StandardAnalyzer(), true);
>>>>>>>>
>>>>>>>> The true parameter means that the old index will be deleted, is
>>>>>>>> that
>>>>>>> your
>>>>>>>> problem?
>>>>>>>>
>>>>>>>> Regards
>>>>>>>> Daniel
>>>>>>>>
>>>>>>>> --
>>>>>>>> http://www.danielnaber.de
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------
>>>>>>>> --
>>>>>>>> --
>>>>>>>> --
>>>>>>>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>>>>>>>> For additional commands, e-mail: java-user-
>>>>>>>> help@lucene.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>
>>>>
>>>> -------------------------------------------------------------------
>>>> --
>>>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>>>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>>>
>>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org