[Koha-bugs] [Bug 12430] Truncation disables relevance ranking (and has issues when using QueryParser)

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jun 17 08:18:13 CEST 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12430

--- Comment #2 from David Cook <dcook at prosentient.com.au> ---
There's a bit of odd code in  Koha\QueryParser\Driver\PQF\query_plan\node.pm,
which is where a lot of the action happens in QP...

When doing a "Library Catalog" search, it tries to use the following code to
create a relevance query branch:

$fieldobj = $self->plan->QueryParser->bib1_mapping_by_name('field',
$relbump->{'classname'}, $relbump->{'field'}, $server);

This means $fieldobj, which should contain our CCL2RPN type mapping, will
always be null because $relbump->{'classname'} and $relbump->{'field'} don't
exist.

This is why the 2nd line in the following code doesn't have an @attr 1=1016 in
it. 

@attr 1=1016 @attr 5=1 @attr 4=6 "test" 
@or
@attr 9=20 @attr 2=102 @attr 5=1 @attr 4=6 "test"

But we don't notice the error in the OPAC, as I think Zebra/Yaz/Zoom/whatever
silently treats the second branch as having @attr 1=1016 as a bare search will
usually be treated as a keyword (ie @attr 1=1016). 

--

Here is another odd bit of code, which is responsible for QueryParser's current
"support" for relevance.

my $relbumps = $self->plan->QueryParser->bib1_mapping_by_name('relevance_bump',
$self->classname, '', $server);

This line will return ALL the relevance_bump mappings under the keyword
class...which are 'titleext' and 'titlekw'.

I think these may have been example mappings...as it doesn't really make sense
to have them under a keyword class search. It should be a "keyword" class
search with a "keyword" field rather than a "titleext" field, in my opinion.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list