Bug 26903

Summary: Authority records not being indexed in Elasticsearch
Product: Koha Reporter: Andrew Fuerste-Henry <andrew>
Component: Searching - ElasticsearchAssignee: Nick Clemens <nick>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P5 - low CC: jonathan.druart, katrin.fischer, martin.renvoize, nick, severine.queune, victor
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.07
Bug Depends on:    
Bug Blocks: 26543    
Attachments: Bug 26903: Unit tests
Bug 26903: Pass record ids and records through to update_index when passed to index_records
Bug 26903: Unit tests
Bug 26903: Pass record ids and records through to update_index when passed to index_records
Bug 26903: Unit tests
Bug 26903: Pass record ids and records through to update_index when passed to index_records
Bug 26903: [20.05.x] Pass record ids and records through to update_index when passed to index_records

Description Andrew Fuerste-Henry 2020-11-03 01:07:42 UTC
To recreate:
- set your SearchEngine to Elastic
- have an authority record
- stage and import it
- use link from completed import to see authority and confirm it exists in your system
- search for authority, confirm you cannot find it
Comment 1 Nick Clemens 2020-11-13 16:40:58 UTC
Created attachment 113613 [details] [review]
Bug 26903: Unit tests
Comment 2 Nick Clemens 2020-11-13 16:41:01 UTC
Created attachment 113614 [details] [review]
Bug 26903: Pass record ids and records through to update_index when passed to index_records

When both a record and record_id are passed to index_records the data should be passed through
to update_index. We missed copying over the record ids to the variable we use as a check.

To test:
1 - Set searchEngine system preference to Elasticsearch
2 - Reindex your db
3 - Search authorities
4 - Edit a record and add 'testwaffle' to the main heading
5 - Search authorities for 'testwaffle' - no results
6 - Apply patch
7 - Edit the record again, change 'testwaffle' to 'testpancake'
8 - Search authorities for 'testpancake' - result!
9 - Confirm imported authorities and authorities added via Z39 are correctly indexed
Comment 3 David Nind 2020-11-14 18:05:10 UTC
Created attachment 113644 [details] [review]
Bug 26903: Unit tests

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2020-11-14 18:05:13 UTC
Created attachment 113645 [details] [review]
Bug 26903: Pass record ids and records through to update_index when passed to index_records

When both a record and record_id are passed to index_records the data should be passed through
to update_index. We missed copying over the record ids to the variable we use as a check.

To test:
1 - Set searchEngine system preference to Elasticsearch
2 - Reindex your db
3 - Search authorities
4 - Edit a record and add 'testwaffle' to the main heading
5 - Search authorities for 'testwaffle' - no results
6 - Apply patch
7 - Edit the record again, change 'testwaffle' to 'testpancake'
8 - Search authorities for 'testpancake' - result!
9 - Confirm imported authorities and authorities added via Z39 are correctly indexed

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 Martin Renvoize 2020-11-16 13:35:40 UTC
Created attachment 113664 [details] [review]
Bug 26903: Unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2020-11-16 13:35:43 UTC
Created attachment 113665 [details] [review]
Bug 26903: Pass record ids and records through to update_index when passed to index_records

When both a record and record_id are passed to index_records the data should be passed through
to update_index. We missed copying over the record ids to the variable we use as a check.

To test:
1 - Set searchEngine system preference to Elasticsearch
2 - Reindex your db
3 - Search authorities
4 - Edit a record and add 'testwaffle' to the main heading
5 - Search authorities for 'testwaffle' - no results
6 - Apply patch
7 - Edit the record again, change 'testwaffle' to 'testpancake'
8 - Search authorities for 'testpancake' - result!
9 - Confirm imported authorities and authorities added via Z39 are correctly indexed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2020-11-16 13:36:42 UTC
Works as expected, passing QA
Comment 8 Jonathan Druart 2020-11-17 11:26:13 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 9 Andrew Fuerste-Henry 2020-12-09 20:24:24 UTC
Doesn't apply cleanly to 20.05, please rebase
Comment 10 Nick Clemens 2020-12-10 11:43:30 UTC
Created attachment 114299 [details] [review]
Bug 26903: [20.05.x] Pass record ids and records through to update_index when passed to index_records

When both a record and record_id are passed to index_records the data should be passed through
to update_index. We missed copying over the record ids to the variable we use as a check.

To test:
1 - Set searchEngine system preference to Elasticsearch
2 - Reindex your db
3 - Search authorities
4 - Edit a record and add 'testwaffle' to the main heading
5 - Search authorities for 'testwaffle' - no results
6 - Apply patch
7 - Edit the record again, change 'testwaffle' to 'testpancake'
8 - Search authorities for 'testpancake' - result!
9 - Confirm imported authorities and authorities added via Z39 are correctly indexed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Bug 26903: Unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 11 Andrew Fuerste-Henry 2020-12-10 21:30:04 UTC
backported to 20.05.x for 20.05.07
Comment 12 Victor Grousset/tuxayo 2020-12-11 16:11:14 UTC
index_records doesn't exist in 19.11

Missing dependencies for 19.11.x, can't backport.