Bug 37433 - Warning 'Use of uninitialized value $f/$d in hash element...' in log when sorting by relevance
Summary: Warning 'Use of uninitialized value $f/$d in hash element...' in log when sor...
Status: RESOLVED DUPLICATE of bug 36879
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low trivial
Assignee: Janusz Kaczmarek
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-23 12:47 UTC by Janusz Kaczmarek
Modified: 2024-09-09 12:55 UTC (History)
1 user (show)

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


Attachments
Bug 37433: Warning 'Use of uninitialized value $f/$d in hash element...' in log when sorting by relevance (2.08 KB, patch)
2024-07-23 13:06 UTC, Janusz Kaczmarek
Details | Diff | Splinter Review
Bug 37433: Warning 'Use of uninitialized value $f/$d in hash element...' in log when sorting by relevance (2.13 KB, patch)
2024-07-23 14:04 UTC, Roman Dolny
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Janusz Kaczmarek 2024-07-23 12:47:10 UTC
With ES, searches with Sort set to Relevance produce following warnings in log file:

[WARN] Use of uninitialized value $f in hash element at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm line 728.
[WARN] Use of uninitialized value $d in hash element at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm line 728.

This is because sort_by = 'relevance' does not contain underscore.
Comment 1 Janusz Kaczmarek 2024-07-23 13:06:59 UTC
Created attachment 169418 [details] [review]
Bug 37433: Warning 'Use of uninitialized value $f/$d in hash element...' in log when sorting by relevance

With ES, searches with Sort set to Relevance produce following warnings
in log file:

[WARN] Use of uninitialized value $f in hash element at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm line 728.
[WARN] Use of uninitialized value $d in hash element at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm line 728.

This is because sort_by = 'relevance' does not contain underscore.

Test plan:
==========
1. Have a test environment with ES enabled.
2. Perform a search for a common word (like 'greek').  Make sure that
    the sort order is set to 'Relevance' (the default option in ktd).
    Check the content of the plack-intranet-error.log file--you should
    see warning lines with a messages
    "Use of uninitialized value $f in hash element ..."
    "Use of uninitialized value $d in hash element ..."
3. Apply the patch;  restart_all.
4. Repeat p. 2.  The log should be clean now.

Sponsored-by: Ignatianum University in Cracow
Comment 2 Roman Dolny 2024-07-23 14:04:09 UTC
Created attachment 169422 [details] [review]
Bug 37433: Warning 'Use of uninitialized value $f/$d in hash element...' in log when sorting by relevance

With ES, searches with Sort set to Relevance produce following warnings
in log file:

[WARN] Use of uninitialized value $f in hash element at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm line 728.
[WARN] Use of uninitialized value $d in hash element at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/QueryBuilder.pm line 728.

This is because sort_by = 'relevance' does not contain underscore.

Test plan:
==========
1. Have a test environment with ES enabled.
2. Perform a search for a common word (like 'greek').  Make sure that
    the sort order is set to 'Relevance' (the default option in ktd).
    Check the content of the plack-intranet-error.log file--you should
    see warning lines with a messages
    "Use of uninitialized value $f in hash element ..."
    "Use of uninitialized value $d in hash element ..."
3. Apply the patch;  restart_all.
4. Repeat p. 2.  The log should be clean now.

Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 3 Janusz Kaczmarek 2024-09-09 12:55:50 UTC

*** This bug has been marked as a duplicate of bug 36879 ***