Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: kinosearch: discuss

Misleading error on invindex open?

 

 

kinosearch discuss RSS feed   Index | Next | Previous | View Threaded


henka at cityweb

Sep 5, 2008, 3:16 AM

Post #1 of 5 (5254 views)
Permalink
Misleading error on invindex open?

Greetings,

As a matter of interest, I noticed the following error when
(incorrectly) opening an existing inverted index in a searcher:

Couldn't _____create_____ directory /invindex at
../c_src/KinoSearch/Util/Compat/DirManip.c:26 kino_DirManip_create_dir
at
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/KinoSearch.pm
line 317

Probably just a semantic thing, since in the DirManip context (I
didn't go digging too deep) it probably makes sense, but from the
caller's point of view it's weird (ie, we're opening a directory which
contains an inverted index, not creating).

...or am I just light-headed because it's almost the weekend...

Cheers!
Henry


_______________________________________________
KinoSearch mailing list
KinoSearch [at] rectangular
http://www.rectangular.com/mailman/listinfo/kinosearch


marvin at rectangular

Sep 5, 2008, 6:44 AM

Post #2 of 5 (4921 views)
Permalink
Re: Misleading error on invindex open? [In reply to]

On Sep 5, 2008, at 3:16 AM, Henka wrote:

> As a matter of interest, I noticed the following error when
> (incorrectly) opening an existing inverted index in a searcher:
>
> Couldn't _____create_____ directory /invindex at ../c_src/KinoSearch/
> Util/Compat/DirManip.c:26 kino_DirManip_create_dir
> at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/
> KinoSearch.pm line 317

> from the caller's point of view it's weird (ie, we're opening a
> directory which contains an inverted index, not creating).

The semantics of Schema->open changed a while back, prior to the
0.20_04 release. What you want now is Schema->read. From the Changes
file:

* KinoSearch::Schema
o create() - Removed.
o read() - Added.
o open() - Behavior changed -- now creates an index if none
detected.

This was a confusing change, no doubt, and I'm sorry it snared you.
If Schema->open had ever appeared in a stable release, modifying it
wouldn't have been an option, but since it only affected devel, I went
with what I thought was the best API ex nihilo. The change wasn't
dangerous to any existing scripts (invalid read locations would have
already been detected and debugged), so the only drawback was that an
early devel-branch user might not notice the API mod and expect the
old behavior when writing a new script.

Marvin Humphrey
Rectangular Research
http://www.rectangular.com/

***************************************************************************
From Schema's POD:
***************************************************************************

=head2 clobber

my $invindex = MySchema->clobber('/path/to/invindex');
my $invindex = $schema->clobber('/path/to/invindex');

Create a directory and initialize a new invindex at the specified
location.
If the specified directory already exists, first attempt to delete any
files
within it that look like index files.

=head2 open

my $invindex = MySchema->open('/path/to/invindex');
my $invindex = $schema->open('/path/to/invindex');

Open an invindex for reading/writing, creating a new one if needed.
All fields
which have ever been defined for this invindex will be added/verified
via
add_field().

=head2 read

my $invindex = MySchema->read('/path/to/invindex');
my $invindex = $schema->read('/path/to/invindex');

Open an invindex for either reading or updating. Fail if the invindex
doesn't
exist. All fields which have ever been defined for this invindex will
be
added/verified via add_field().



_______________________________________________
KinoSearch mailing list
KinoSearch [at] rectangular
http://www.rectangular.com/mailman/listinfo/kinosearch


henka at cityweb

Sep 5, 2008, 7:05 AM

Post #3 of 5 (4921 views)
Permalink
Re: Misleading error on invindex open? [In reply to]

Quoting "Marvin Humphrey" <marvin [at] rectangular>:
> This was a confusing change, no doubt, and I'm sorry it snared you.

Cool, thanks for the prompt response.

Regards
Henry


_______________________________________________
KinoSearch mailing list
KinoSearch [at] rectangular
http://www.rectangular.com/mailman/listinfo/kinosearch


henka at cityweb

Sep 5, 2008, 7:20 AM

Post #4 of 5 (4931 views)
Permalink
Re: Misleading error on invindex open? [In reply to]

Quoting "Marvin Humphrey" <marvin [at] rectangular>:
> On Sep 5, 2008, at 3:16 AM, Henka wrote:
>
>> As a matter of interest, I noticed the following error when
>> (incorrectly) opening an existing inverted index in a searcher:

I think what really snared me was the implied "create" when using a
*Searcher*, not indexer.

Regards
Henry


_______________________________________________
KinoSearch mailing list
KinoSearch [at] rectangular
http://www.rectangular.com/mailman/listinfo/kinosearch


marvin at rectangular

Sep 5, 2008, 9:21 AM

Post #5 of 5 (4916 views)
Permalink
Re: Misleading error on invindex open? [In reply to]

On Sep 5, 2008, at 7:20 AM, Henka wrote:

> I think what really snared me was the implied "create" when using a
> *Searcher*, not indexer.

I agree that it would be nice to force 'read' when opening a Searcher,
but it can't be helped -- the error occurs before the Searcher
constructor is entered.

my $searcher = KinoSearch::Searcher->new(
invindex => MySchema->open('/path/to/invindex'),
);

Marvin Humphrey
Rectangular Research
http://www.rectangular.com/


_______________________________________________
KinoSearch mailing list
KinoSearch [at] rectangular
http://www.rectangular.com/mailman/listinfo/kinosearch

kinosearch discuss RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.