Retain the index

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Retain the index

anjana m
I want to retain the older index.
I dont want to delete the older index.
Please help me.
Does the recent release has the option to update the indexes without
deleting it.
I am ruuning the indexer on my sun application server.
and its thorwing  exceptions  like cannot delete indexex.
now every time i add new docs..i need to create a new index directory
andmake my program point to thenew index directory.
Please provide me..info about how can i handle the same..
And also i would like to know abt the latest version..where it has fetures
to update indexes without deleting it..


Thanks and regards
anjana
Reply | Threaded
Open this post in threaded view
|

Re: Retain the index

Erick Erickson
This should not be happening. I've got to assume that you have
more than one IndexWriter open at the same time.

There's no problem at all with updating an existing index that
I've ever seen, any similar errors on my part have been coding
errors on my part.

So first make absolutely sure that your IndxWriters are closing
properly. If you're convinced that's the case, can you post some of
your code?

Best
Erick

On Jan 25, 2008 3:05 AM, anjana m <[hidden email]> wrote:

> I want to retain the older index.
> I dont want to delete the older index.
> Please help me.
> Does the recent release has the option to update the indexes without
> deleting it.
> I am ruuning the indexer on my sun application server.
> and its thorwing  exceptions  like cannot delete indexex.
> now every time i add new docs..i need to create a new index directory
> andmake my program point to thenew index directory.
> Please provide me..info about how can i handle the same..
> And also i would like to know abt the latest version..where it has fetures
> to update indexes without deleting it..
>
>
> Thanks and regards
> anjana
>
Reply | Threaded
Open this post in threaded view
|

Re: Retain the index

Developer Developer
Check if there are any lock files in your index directory after the process
is completed. There should be no lock files if the index was correctly
closed .


On Jan 25, 2008 8:59 AM, Erick Erickson <[hidden email]> wrote:

> This should not be happening. I've got to assume that you have
> more than one IndexWriter open at the same time.
>
> There's no problem at all with updating an existing index that
> I've ever seen, any similar errors on my part have been coding
> errors on my part.
>
> So first make absolutely sure that your IndxWriters are closing
> properly. If you're convinced that's the case, can you post some of
> your code?
>
> Best
> Erick
>
> On Jan 25, 2008 3:05 AM, anjana m <[hidden email]> wrote:
>
> > I want to retain the older index.
> > I dont want to delete the older index.
> > Please help me.
> > Does the recent release has the option to update the indexes without
> > deleting it.
> > I am ruuning the indexer on my sun application server.
> > and its thorwing  exceptions  like cannot delete indexex.
> > now every time i add new docs..i need to create a new index directory
> > andmake my program point to thenew index directory.
> > Please provide me..info about how can i handle the same..
> > And also i would like to know abt the latest version..where it has
> fetures
> > to update indexes without deleting it..
> >
> >
> > Thanks and regards
> > anjana
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Retain the index

anjana m
In reply to this post by anjana m
My Indexing Code
-------------------------------
public  void index(File indexDir, File dataDir) throws IOException
     {
           if (!dataDir.exists() || !dataDir.isDirectory()) {
            throw new IOException(dataDir + " does not exist or is not a
directory");
        }
        IndexWriter writer = new IndexWriter(indexDir, new
StandardAnalyzer(), true);
        indexDirectory(writer, dataDir);
        writer.close();
    }
      public  void indexDirectory(IndexWriter writer, File dir) throws
IOException {
        File[] files = dir.listFiles();
    System.out.println("TOTAL NUMBER OF FILES :"+files.length);
        for (int i=0; i < files.length; i++)
        {

             File f = files[i];
            if (f.isDirectory()) {
                indexDirectory(writer, f);  // recurse
            } else if (f.getName().endsWith(".txt") ||
f.getName().endsWith(".doc"))
{
                indexFile(writer, f);
            }
        }
    }
      public  void indexFile(IndexWriter writer, File f) throws IOException
       {

        System.out.println("Indexing " + f.getName()); /*Print the Indexed
File Names*/
        Document doc = new Document();
        doc.add(Field.Text("contents", new FileReader(f)));
        doc.add(Field.Keyword("filename", f.getCanonicalPath()));
        writer.addDocument(doc);
    }

--------------------------------------------------------------------
My Searching code...public  Vector search(File indexDir, String q)  throws
Exception
      {
      Vector vecname=new Vector();
    Directory fsDir = FSDirectory.getDirectory(indexDir, false);
    IndexSearcher is = new IndexSearcher(fsDir);
    Query query = QueryParser.parse(q, "contents", new StandardAnalyzer());
    Hits hits = is.search(query);
    System.out.println("Found " + hits.length() + " document(s) that matched
query '" + q + "':");
    for (int i = 0; i < hits.length(); i++)
    {
        Document doc = hits.doc(i);
        vecname.add(doc.get("filename"));
        //System.out.println(doc.get("filename"));
        //System.out.println(hits.length());
    }
    /** Creates a new instance of ContentSearcher */
    return vecname;
}
------------------------------------------------------------------


On Jan 25, 2008 1:35 PM, anjana m <[hidden email]> wrote:

> I want to retain the older index.
> I dont want to delete the older index.
> Please help me.
> Does the recent release has the option to update the indexes without
> deleting it.
> I am ruuning the indexer on my sun application server.
> and its thorwing  exceptions  like cannot delete indexex.
> now every time i add new docs..i need to create a new index directory
> andmake my program point to thenew index directory.
> Please provide me..info about how can i handle the same..
> And also i would like to know abt the latest version..where it has fetures
> to update indexes without deleting it..
>
>
> Thanks and regards
> anjana
>
Reply | Threaded
Open this post in threaded view
|

Re: Retain the index

Daniel Naber-10
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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Retain the index

anjana m
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 <[hidden email]> 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: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Retain the index

Erick Erickson
Set the parameter to false as per the documentation....

Erick

On Jan 27, 2008 5:11 AM, anjana m <[hidden email]> 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 <[hidden email]>
> 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: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Retain the index

anjana m
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 <[hidden email]> wrote:

> Set the parameter to false as per the documentation....
>
> Erick
>
> On Jan 27, 2008 5:11 AM, anjana m <[hidden email]> 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 <[hidden email]>
> > 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: [hidden email]
> > > For additional commands, e-mail: [hidden email]
> > >
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Retain the index

Michael McCandless-2

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 <[hidden email]>  
> wrote:
>
>> Set the parameter to false as per the documentation....
>>
>> Erick
>>
>> On Jan 27, 2008 5:11 AM, anjana m <[hidden email]> 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  
>>> <[hidden email]>
>>> 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: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Retain the index

anjana m
On false..
i get this error...
wht do you suggest me to do further....
i am using lucene 1.4 final..
plsease help

Exception in thread "main" java.io.IOException: Lock obtain timed out:
Lock@C:\DOCUME~1\ANJANA\LOCALS~1\Temp\lucene-
26fee40bb91b3504c3589207f2d7efa3-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:63)
Java Result: 1


On Jan 31, 2008 2:49 PM, Michael McCandless <[hidden email]>
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 <[hidden email]>
> > wrote:
> >
> >> Set the parameter to false as per the documentation....
> >>
> >> Erick
> >>
> >> On Jan 27, 2008 5:11 AM, anjana m <[hidden email]> 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
> >>> <[hidden email]>
> >>> 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: [hidden email]
> >>>> For additional commands, e-mail: [hidden email]
> >>>>
> >>>>
> >>>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Retain the index

anjana m
In reply to this post by Michael McCandless-2
How do i remove the locks..?



On Jan 31, 2008 2:49 PM, Michael McCandless <[hidden email]>
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 <[hidden email]>
> > wrote:
> >
> >> Set the parameter to false as per the documentation....
> >>
> >> Erick
> >>
> >> On Jan 27, 2008 5:11 AM, anjana m <[hidden email]> 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
> >>> <[hidden email]>
> >>> 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: [hidden email]
> >>>> For additional commands, e-mail: [hidden email]
> >>>>
> >>>>
> >>>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Retain the index

Michael McCandless-2

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  
> <[hidden email]>
> 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 <[hidden email]>
>>> wrote:
>>>
>>>> Set the parameter to false as per the documentation....
>>>>
>>>> Erick
>>>>
>>>> On Jan 27, 2008 5:11 AM, anjana m <[hidden email]> 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
>>>>> <[hidden email]>
>>>>> 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: [hidden email]
>>>>>> For additional commands, e-mail: [hidden email]
>>>>>>
>>>>>>
>>>>>
>>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Retain the index

anjana m
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 <[hidden email]>
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
> > <[hidden email]>
> > 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 <[hidden email]>
> >>> wrote:
> >>>
> >>>> Set the parameter to false as per the documentation....
> >>>>
> >>>> Erick
> >>>>
> >>>> On Jan 27, 2008 5:11 AM, anjana m <[hidden email]> 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
> >>>>> <[hidden email]>
> >>>>> 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: [hidden email]
> >>>>>> For additional commands, e-mail: [hidden email]
> >>>>>>
> >>>>>>
> >>>>>
> >>>>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Retain the index

Michael McCandless-2

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  
> <[hidden email]>
> 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
>>> <[hidden email]>
>>> 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 <[hidden email]>
>>>>> wrote:
>>>>>
>>>>>> Set the parameter to false as per the documentation....
>>>>>>
>>>>>> Erick
>>>>>>
>>>>>> On Jan 27, 2008 5:11 AM, anjana m <[hidden email]>  
>>>>>> 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
>>>>>>> <[hidden email]>
>>>>>>> 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: [hidden email]
>>>>>>>> For additional commands, e-mail: java-user-
>>>>>>>> [hidden email]
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>
>>>>
>>>> -------------------------------------------------------------------
>>>> --
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Retain the index

anjana m
In reply to this post by Michael McCandless-2
I got this error after dleteing that file

Exception in thread "main" java.io.FileNotFoundException:
C:\pIndexed\segments (The system cannot find the file specified)
        at java.io.RandomAccessFile.open(Native Method)
        at java.io.RandomAccessFile.<init>(RandomAccessFile.java:212)
        at org.apache.lucene.store.FSInputStream$Descriptor.<init>(
FSDirectory.java:376)
        at org.apache.lucene.store.FSInputStream.<init>(FSDirectory.java
:405)
        at org.apache.lucene.store.FSDirectory.openFile(FSDirectory.java
:268)
        at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:40)
        at org.apache.lucene.index.IndexWriter$1.doBody(IndexWriter.java
:233)
        at org.apache.lucene.store.Lock$With.run(Lock.java:109)
        at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:228)
        at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:193)
        at com.cecilia.wim.process.Indexer.index(Indexer.java:29)
        at com.cecilia.wim.process.Indexer.main(Indexer.java:68)


On Thu, Jan 31, 2008 at 2:49 PM, Michael McCandless <
[hidden email]> 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 <[hidden email]>
> > wrote:
> >
> >> Set the parameter to false as per the documentation....
> >>
> >> Erick
> >>
> >> On Jan 27, 2008 5:11 AM, anjana m <[hidden email]> 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
> >>> <[hidden email]>
> >>> 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: [hidden email]
> >>>> For additional commands, e-mail: [hidden email]
> >>>>
> >>>>
> >>>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Retain the index

Michael McCandless-2
Now it looks like you are creating the IndexWriter with create=false
when in fact there is no existing index in that directory.

Mike

<[hidden email]> wrote:

> I got this error after dleteing that file
>
>  Exception in thread "main" java.io.FileNotFoundException:
>  C:\pIndexed\segments (The system cannot find the file specified)
>         at java.io.RandomAccessFile.open(Native Method)
>         at java.io.RandomAccessFile.<init>(RandomAccessFile.java:212)
>         at org.apache.lucene.store.FSInputStream$Descriptor.<init>(
>  FSDirectory.java:376)
>         at org.apache.lucene.store.FSInputStream.<init>(FSDirectory.java
>  :405)
>         at org.apache.lucene.store.FSDirectory.openFile(FSDirectory.java
>  :268)
>         at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:40)
>         at org.apache.lucene.index.IndexWriter$1.doBody(IndexWriter.java
>  :233)
>         at org.apache.lucene.store.Lock$With.run(Lock.java:109)
>         at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:228)
>
>         at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:193)
>
>         at com.cecilia.wim.process.Indexer.index(Indexer.java:29)
>         at com.cecilia.wim.process.Indexer.main(Indexer.java:68)
>
>
>
>  On Thu, Jan 31, 2008 at 2:49 PM, Michael McCandless <
>  [hidden email]> 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 <[hidden email]>
>  > > wrote:
>  > >
>  > >> Set the parameter to false as per the documentation....
>  > >>
>  > >> Erick
>  > >>
>  > >> On Jan 27, 2008 5:11 AM, anjana m <[hidden email]> 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
>  > >>> <[hidden email]>
>  > >>> 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: [hidden email]
>  > >>>> For additional commands, e-mail: [hidden email]
>  > >>>>
>  > >>>>
>  > >>>
>  > >>
>  >
>  >
>
> > ---------------------------------------------------------------------
>
> > To unsubscribe, e-mail: [hidden email]
>  > For additional commands, e-mail: [hidden email]
>  >
>  >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]