Skip to main content.
home | support | download

Back to List Archive

Re: [swish-e] Change the indexed 'title'

From: Peter Karman <peter(at)>
Date: Fri Oct 26 2007 - 17:50:45 GMT
On 10/26/2007 12:44 PM, wrote:
> Ok,
> I really hate to be a pain here - but.... ;-)
> So I am in - and I am where $DocTitle is being populated with the title that will show up in the search results..
>       my $DocTitle = $results->config('title_property') || 'swishtitle';
> So I am 'just' trying (for right now) to get it to show the 'strong' instead of the 'title_property'... So I changed the string to:
>       my $DocTitle = $results->Property('strong');
> and nothing.. it errors out.. I saw many variations of the '$results->Property' field in the archives - and I tried all of them: $results->property, $res->Property, $res->property, as well as a variation of single and double quotes (again because I saw a mixture in the archives)...
> For the life of me I cannot get it to just show that defined PropertyName on the output of the search.... what am I missing here??

first, read the SWISH::API docs so you can start to understand how the Perl API
works. This assumes you have configured swish.cgi to use SWISH::API and not
just the fork/exec with the swish-e tool.

second, make sure you have configured swish.cgi to return all the properties
you are interested in displaying.

third, get to know the indispensable Perl tools like Carp and Data::Dump (the
latter I prefer to the venerable Data::Dumper). Carp is a standard module and
Data::Dump is on CPAN.

fourth, using those tools, find out what $results is in your code above. I
don't suspect it has a Property() method. Something like:

 carp dump $results;

should show up in your error log (you are wathing your error log, right? If
not, do that before you do anything else. I always have 'tail -f error_log'
running in a terminal when I do any dev work like this.)

Peter Karman  .  peter(at)  .

Users mailing list
Received on Fri Oct 26 13:50:45 2007