Bug 12442 - Query... variables should be defined within loop in Search.pm
Summary: Query... variables should be defined within loop in Search.pm
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-18 05:04 UTC by David Cook
Modified: 2023-06-16 01:11 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2014-06-18 05:04:38 UTC
Currently, the Query... variables (ie QueryStemming, QueryAutoTruncate, QueryWeightFields, QueryFuzzy, and QueryRemoveStopwords) are defined outside a loop, but they should be defined within the loop.

This is because each iteration of the loop can disable these variables, which will keep them disabled for each subsequent iteration (and thus each different index/operand pair).
Comment 1 David Cook 2015-01-15 00:47:42 UTC
This is still a thing last time I checked... should fix this one of these days...
Comment 2 Katrin Fischer 2020-01-05 14:36:05 UTC
David, can you tell if this is still valid and provide a little more information?
Comment 3 David Cook 2020-01-06 05:13:01 UTC
(In reply to Katrin Fischer from comment #2)
> David, can you tell if this is still valid and provide a little more
> information?

I haven't looked in a long time, but I'd imagine that it's still valid.

I think an example is QueryAutoTruncate. When it's on, all the index/operand pairs should have truncation enabled. However, there are some indexes that don't support truncation, so they'll turn QueryAutoTruncate off. 

So in theory you could have something like this:

Pair0-Truncated, Pair1-Can't truncate disable auto truncation,Pair2-NotTruncated, Pair3-NotTruncated

When really it should be like this:

Pair0-Truncated, Pair1-Can't truncate, Pair2-Truncated, Pair3-Truncated

Apologies if that still sounds too vague.
Comment 4 David Cook 2023-06-16 01:11:55 UTC
Pretty sure this is still a problem.

One of these days I need to sit down and have a big search review...