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 lu...@nitwit.de on 2007/04/08 18:58:13 UTC

built index doesn't contain a segments file

Hi!

I feel somewhat stupid for asking this but...I let two thread build an index 
and the merge it into one on disk via addIndexes(), optimize() and close(). 
This is what it looks like on disk:

-rw-r--r-- 1 root root 25608841 Apr  8 18:37 _4.cfs
-rw-r--r-- 1 root root       20 Apr  8 18:37 segments.gen
-rw-r--r-- 1 root root       41 Apr  8 18:37 segments_4

However if I try to IndexReader.open() the index lucene complains about a 
missing segments file.

Well, right, it's not there. But why not?

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


Re: built index doesn't contain a segments file

Posted by Erick Erickson <er...@gmail.com>.
Yep, you got it....


On 4/8/07, lucene@nitwit.de <lu...@nitwit.de> wrote:
>
> On Sunday 08 April 2007 19:28, Erick Erickson wrote:
> >  If it means they are two are completely separate
> > operations working with two different indexes in two separate
> > directories, that's a different situation.....
>
> That's what I do.
>
> > But are you completely sure you're closing both indexwriters etc.
> > before you try to merge them?
>
> Well, at the end of run() I explicitly close the index and I wait for all
> threads to finished (join()) before I merge. So, I'm pretty sure, yes.
>
> But if it's absolutely mandatory to close the indices addIndexes() should
> throw some exception in case they haven't closed.
>
> > Also, what version of Lucene are you using? I ask because
> > there has been some work in that area for Lucene 2.1, so it
> > could point towards different issues if you're using an older
> > version.
>
> I actually build the index with 2.1.0 but open it with 2.0.0....oh, it
> comes
> to my mind that there have been some changes in the index format, I cannot
> open an index built with 2.1.0 using 2.0.0, right?
>
> Oops, my fault :) Sorry...
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: built index doesn't contain a segments file

Posted by lu...@nitwit.de.
On Sunday 08 April 2007 19:28, Erick Erickson wrote:
>  If it means they are two are completely separate
> operations working with two different indexes in two separate
> directories, that's a different situation.....

That's what I do.

> But are you completely sure you're closing both indexwriters etc.
> before you try to merge them?

Well, at the end of run() I explicitly close the index and I wait for all 
threads to finished (join()) before I merge. So, I'm pretty sure, yes.

But if it's absolutely mandatory to close the indices addIndexes() should 
throw some exception in case they haven't closed.

> Also, what version of Lucene are you using? I ask because
> there has been some work in that area for Lucene 2.1, so it
> could point towards different issues if you're using an older
> version.

I actually build the index with 2.1.0 but open it with 2.0.0....oh, it comes 
to my mind that there have been some changes in the index format, I cannot 
open an index built with 2.1.0 using 2.0.0, right?

Oops, my fault :) Sorry...

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


Re: built index doesn't contain a segments file

Posted by Erick Erickson <er...@gmail.com>.
Please explain a little more what "I let two threads build an index"
means. If it means two threads operate on the *same* index, that's
a problem (but you're probably not doing this or you'd be getting
lock violations I expect).

 If it means they are two are completely separate
operations working with two different indexes in two separate
directories, that's a different situation.....

But are you completely sure you're closing both indexwriters etc.
before you try to merge them?

Also, what version of Lucene are you using? I ask because
there has been some work in that area for Lucene 2.1, so it
could point towards different issues if you're using an older
version.

Best
Erick@ItsUnseasonablyColdInMichiganOrIdBeOutside

On 4/8/07, lucene@nitwit.de <lu...@nitwit.de> wrote:
>
> Hi!
>
> I feel somewhat stupid for asking this but...I let two thread build an
> index
> and the merge it into one on disk via addIndexes(), optimize() and
> close().
> This is what it looks like on disk:
>
> -rw-r--r-- 1 root root 25608841 Apr  8 18:37 _4.cfs
> -rw-r--r-- 1 root root       20 Apr  8 18:37 segments.gen
> -rw-r--r-- 1 root root       41 Apr  8 18:37 segments_4
>
> However if I try to IndexReader.open() the index lucene complains about a
> missing segments file.
>
> Well, right, it's not there. But why not?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>