Skip to main content.
home | support | download

Back to List Archive

Re: Working examples of $swish -> PropertyList() ?

From: Peter Karman <peter(at)not-real.peknet.com>
Date: Wed Oct 12 2005 - 12:58:51 GMT
Your code looks right to me. One thing to check is whether all your
indexes have the same properties defined. I have a comment in my working
code to that effect (which I assume is supposed to remind me of something
I once learned...).

Must be using API vers 0.03, iirc.

Here's how I use it (very similar to your example). For each result, I
pull out only my non-swish* properties and save them to a hash.

# we assume all indexes have identical properties

my @p = $swish->PropertyList( ($swish->IndexNames)[0] );
for my $pobj (@p) {

    my $name = $pobj->Name;
    next if $name =~ m/^swish/;	# skip build-in props
    $props->{$name} = $name;

}


> Folks:
>
> I'm having a nasty time getting the PropertyList method to work in the
> Perl API; calls to it seem to just hang indefinitely, and strace is
> little help.
> In context:
>
>     my $swh = SWISH::API -> new('/some/index/somewhere.index
> /yet/another/index.index');
>
>     foreach my $db($swh -> IndexNames){
>         my (@res) = $swh -> PropertyList($db);
>         foreach my $r (@res){
>             push @props, $r -> Name();
>         }
>     }
>
> Hangs in the debugger at the first call to PropertyList().  I checked
> the archive, but the only discussion of PropertyList is as a method for
> SwishResult, not a swish handle.  The documentation curiously says that
> PropertyList's one parameter is an "open" index file -- is this
> significant in some way I'm just not getting?
>
> t.
>
> --
> +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
> Thomas R. Bruce (trb2@cornell.edu)
> Director, Legal Information Institute
> Cornell Law School
> http://www.law.cornell.edu/
>
> "We had a knob.  All we had to do was turn it."
>                                  -- Les Paul
> +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
>


-- 
Peter Karman . http://peknet.com/ . peter(at)not-real.peknet.com
Received on Wed Oct 12 05:58:51 2005