Bug 26313 - "Show analytics" and "Show volumes" links don't work with Elasticsearch and UseControlNumber
Summary: "Show analytics" and "Show volumes" links don't work with Elasticsearch and U...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Nick Clemens (kidclamp)
QA Contact: Tomás Cohen Arazi (tcohen)
URL:
Keywords:
Depends on:
Blocks: 28326
  Show dependency treegraph
 
Reported: 2020-08-27 21:31 UTC by Katrin Fischer
Modified: 2021-12-13 21:11 UTC (History)
6 users (show)

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


Attachments
Bug 26313: "Show analytics" link must use uppercase for booleans (2.04 KB, patch)
2020-09-01 12:35 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 26313: "Show analytics" link must use uppercase for booleans (2.09 KB, patch)
2020-09-01 19:55 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 26313: (follow-up) Fix OPAC and "Show volumes" links (4.72 KB, patch)
2020-09-01 19:55 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 26313: "Show analytics" link must use uppercase for booleans (2.14 KB, patch)
2020-09-02 12:26 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 26313: (follow-up) Fix OPAC and "Show volumes" links (4.77 KB, patch)
2020-09-02 12:26 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2020-08-27 21:31:10 UTC
The "Show analytics" links don't work with Elasticsearch and UseControlnumber enabled.

To test:
- Turn SearchEngine to Elasticsearch and make sure it works
- Pick any serial record in your database, make sure 001 is set
- Go to new > new child record
- Fill in 245 and save
- Click on the "In" link, it should bring you to the parent record
- Click on "Show analytics" => there will be no result

What the search tries to do:
   rcn:11388674 and (bib-level:a or bib-level:b)

- find a record with $w 11388674
- that is also a serial or monographic component part (LDR pos 7)

rcn: search alone works.
bib-level:a alone works

Something wrong with the search syntax for Elasticsearch maybe?
Comment 1 Nick Clemens (kidclamp) 2020-09-01 12:35:24 UTC
Created attachment 109423 [details] [review]
Bug 26313: "Show analytics" link must use uppercase for booleans

In elasticsearch we only treat AND and OR as boolean operators if
they are capitalized

To test:
- Turn SearchEngine to Elasticsearch and make sure it works
- Pick any serial record in your database, make sure 001 is set
- Go to new > new child record
- Fill in 245 and save
- Click on the "In" link, it should bring you to the parent record
- Click on "Show analytics" => there will be no result
- Apply patch
- restart and reload
- Try again
- It works!
- Switch SearchEngine syspref to 'Zebra'
- Test again
- It still works!
Comment 2 Tomás Cohen Arazi (tcohen) 2020-09-01 12:42:24 UTC
Well, this is interesting. Shouldn't we make the query parser handle things without case sensitivity?
Comment 3 Katrin Fischer 2020-09-01 13:18:37 UTC
(In reply to Tomás Cohen Arazi from comment #2)
> Well, this is interesting. Shouldn't we make the query parser handle things
> without case sensitivity?

I see an advantage of this behaviour. If a record title contains 'and' or 'or' they won't get seen as boolean operators (= less accidental booleans). I believe that this is an issue with Zebra currently, but couldn't locate the right bug.
Comment 4 Tomás Cohen Arazi (tcohen) 2020-09-01 17:54:49 UTC
I agree! Let's push this forward!!
Comment 5 Katrin Fischer 2020-09-01 19:24:30 UTC
I'll sign off and provide a few missing changes (OPAC). Tomas, can you then take over for QA?
Comment 6 Katrin Fischer 2020-09-01 19:55:13 UTC
Created attachment 109457 [details] [review]
Bug 26313: "Show analytics" link must use uppercase for booleans

In elasticsearch we only treat AND and OR as boolean operators if
they are capitalized

To test:
- Turn SearchEngine to Elasticsearch and make sure it works
- Pick any serial record in your database, make sure 001 is set
- Go to new > new child record
- Fill in 245 and save
- Click on the "In" link, it should bring you to the parent record
- Click on "Show analytics" => there will be no result
- Apply patch
- restart and reload
- Try again
- It works!
- Switch SearchEngine syspref to 'Zebra'
- Test again
- It still works!

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Katrin Fischer 2020-09-01 19:55:17 UTC
Created attachment 109458 [details] [review]
Bug 26313: (follow-up) Fix OPAC and "Show volumes" links

Elasticsearch requires the booleans in search requests to
be uppercase. This fixes the "Show analytics" link in
OPAC (same as first patch for intranet) and the "Show volume"
link.

To test both patches:

Set UseControlNumber = Use

1) "Show analytics"
- Turn SearchEngine to Elasticsearch and make sure it works
- Pick any serial record in your database, make sure 001 is set
- Go to new > new child record
- Fill in 245 and save
- For both staff and OPAC:
  - Click on the "In" link, it should bring you to the parent record
  - Click on "Show analytics", it should show your analytical record
- Switch to "Zebra" - verify links still work.

2) "Show volumes"
- Turn SearchEngine to Elasticsearch again
- Pick any serial record in your database, make sure 001 is set
- Set LDR, pos. 19 = a - Set
- Note 001 value
- Find another record and edit it
- Set LDR, pos. 19 = a or b, LDR 7 not a or b (m will work)
- Set 773$ title of set record $w 001 of set record
- For both staff and OPAC:
  - Click on the "In: link, it should bring up your set record
  - Click on the "Show volumes" link, it should bring up the volume

- Switch to "Zebra" - verify all links still work.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Tomás Cohen Arazi (tcohen) 2020-09-02 12:26:37 UTC
Created attachment 109509 [details] [review]
Bug 26313: "Show analytics" link must use uppercase for booleans

In elasticsearch we only treat AND and OR as boolean operators if
they are capitalized

To test:
- Turn SearchEngine to Elasticsearch and make sure it works
- Pick any serial record in your database, make sure 001 is set
- Go to new > new child record
- Fill in 245 and save
- Click on the "In" link, it should bring you to the parent record
- Click on "Show analytics" => there will be no result
- Apply patch
- restart and reload
- Try again
- It works!
- Switch SearchEngine syspref to 'Zebra'
- Test again
- It still works!

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 9 Tomás Cohen Arazi (tcohen) 2020-09-02 12:26:43 UTC
Created attachment 109510 [details] [review]
Bug 26313: (follow-up) Fix OPAC and "Show volumes" links

Elasticsearch requires the booleans in search requests to
be uppercase. This fixes the "Show analytics" link in
OPAC (same as first patch for intranet) and the "Show volume"
link.

To test both patches:

Set UseControlNumber = Use

1) "Show analytics"
- Turn SearchEngine to Elasticsearch and make sure it works
- Pick any serial record in your database, make sure 001 is set
- Go to new > new child record
- Fill in 245 and save
- For both staff and OPAC:
  - Click on the "In" link, it should bring you to the parent record
  - Click on "Show analytics", it should show your analytical record
- Switch to "Zebra" - verify links still work.

2) "Show volumes"
- Turn SearchEngine to Elasticsearch again
- Pick any serial record in your database, make sure 001 is set
- Set LDR, pos. 19 = a - Set
- Note 001 value
- Find another record and edit it
- Set LDR, pos. 19 = a or b, LDR 7 not a or b (m will work)
- Set 773$ title of set record $w 001 of set record
- For both staff and OPAC:
  - Click on the "In: link, it should bring up your set record
  - Click on the "Show volumes" link, it should bring up the volume

- Switch to "Zebra" - verify all links still work.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 10 Jonathan Druart 2020-09-03 13:05:04 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 11 Lucas Gass (lukeg) 2020-09-14 21:32:40 UTC
backported to 20.05.x for 20.05.04
Comment 12 Aleisha Amohia 2020-09-15 11:41:28 UTC
backported to 19.11.x for 19.11.10
Comment 13 Victor Grousset/tuxayo 2020-09-20 19:20:14 UTC
Not backported to oldoldstable (19.05.x). Feel free to ask if it's needed.