Skip to main content.
home | support | download

Back to List Archive

output_format FIELDS not working in SWISH.pm

From: Philip Mak <pmak(at)not-real.aaanime.net>
Date: Wed May 16 2001 - 07:15:35 GMT
I have a website that uses SWISH to perform a search in the back end. My
code is doing this:

my $sh = SWISH->connect('Fork',
  prog       => '/usr/qd/software/swish/swish-e',
  indexes    => '/usr/qd/software/swish/sql.dat',
  output_format => {
    FIELDS => [qw/swishdocpath subject/],
    FORMAT => {}
  },
  results    => sub {
    my ($sh, $hit) = @_;
    push(@hits, $hit->swishdocpath);
print "TEST: ".$hit->subject."<br>";
  }
);

When I run the code, $hit->swishdocpath is inserted into @hits correctly,
but $hit->subject always comes out blank.

The input documents are XML (indexed with -S prog), and every document has
a <subject>...</subject> part.

What am I doing wrong?

-Philip Mak (pmak@aaanime.net)
Received on Wed May 16 07:17:35 2001