Bug 33594: Only sort on title main heading

This patch simply remvoes sort from all elements that are not strictly
the main title

Note:
If multiple fields are set as sort, they are collapsed into a single entry in
the {field}__sort field in the ES index. The order will be determined by the order in
the marc record

To test:
1 - Apply patch
2 - perl misc/search_tools/rebuild_elasticsearch -r -v
3 - Search the catalog
4 - Sort by title
5 - Confirm records are correct
6 - Add a 240 (before the 245) with subfield a 'AAAAA'
7 - Confirm sorting is not affected
8 - View record details, click 'Elasticsearch record: Show'
9 - Find 'title__sort' and confirm it looks correct (does not include AAAAA)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Nick Clemens 2023-05-05 12:51:19 +00:00 committed by Tomas Cohen Arazi
parent 7f1f0bc5b7
commit af505c9117
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -3601,37 +3601,37 @@ biblios:
- facet: '' - facet: ''
marc_field: '130' marc_field: '130'
marc_type: marc21 marc_type: marc21
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: '210' marc_field: '210'
marc_type: marc21 marc_type: marc21
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: '211' marc_field: '211'
marc_type: marc21 marc_type: marc21
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: '212' marc_field: '212'
marc_type: marc21 marc_type: marc21
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: '214' marc_field: '214'
marc_type: marc21 marc_type: marc21
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: '222' marc_field: '222'
marc_type: marc21 marc_type: marc21
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: '240' marc_field: '240'
marc_type: marc21 marc_type: marc21
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 245abp marc_field: 245abp
@ -3641,57 +3641,57 @@ biblios:
- facet: '' - facet: ''
marc_field: '246' marc_field: '246'
marc_type: marc21 marc_type: marc21
sort: 1 sort: 0
suggestible: 1 suggestible: 1
- facet: '' - facet: ''
marc_field: '247' marc_field: '247'
marc_type: marc21 marc_type: marc21
sort: 1 sort: 0
suggestible: 1 suggestible: 1
- facet: '' - facet: ''
marc_field: 490a marc_field: 490a
marc_type: marc21 marc_type: marc21
sort: 1 sort: 0
suggestible: 1 suggestible: 1
- facet: '' - facet: ''
marc_field: 505t marc_field: 505t
marc_type: marc21 marc_type: marc21
sort: 1 sort: 0
suggestible: 1 suggestible: 1
- facet: '' - facet: ''
marc_field: 700t marc_field: 700t
marc_type: marc21 marc_type: marc21
sort: 1 sort: 0
suggestible: 1 suggestible: 1
- facet: '' - facet: ''
marc_field: 710t marc_field: 710t
marc_type: marc21 marc_type: marc21
sort: 1 sort: 0
suggestible: 1 suggestible: 1
- facet: '' - facet: ''
marc_field: 711t marc_field: 711t
marc_type: marc21 marc_type: marc21
sort: 1 sort: 0
suggestible: 1 suggestible: 1
- facet: '' - facet: ''
marc_field: '730' marc_field: '730'
marc_type: marc21 marc_type: marc21
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: '740' marc_field: '740'
marc_type: marc21 marc_type: marc21
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: '780' marc_field: '780'
marc_type: marc21 marc_type: marc21
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: '785' marc_field: '785'
marc_type: marc21 marc_type: marc21
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 200a marc_field: 200a
@ -3701,287 +3701,287 @@ biblios:
- facet: '' - facet: ''
marc_field: 200c marc_field: 200c
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: 1 suggestible: 1
- facet: '' - facet: ''
marc_field: 200d marc_field: 200d
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: 1 suggestible: 1
- facet: '' - facet: ''
marc_field: 200e marc_field: 200e
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: 1 suggestible: 1
- facet: '' - facet: ''
marc_field: 200h marc_field: 200h
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: 1 suggestible: 1
- facet: '' - facet: ''
marc_field: 200i marc_field: 200i
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: 1 suggestible: 1
- facet: '' - facet: ''
marc_field: '205' marc_field: '205'
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: 1 suggestible: 1
- facet: '' - facet: ''
marc_field: 304a marc_field: 304a
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: 1 suggestible: 1
- facet: '' - facet: ''
marc_field: 327a marc_field: 327a
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 327b marc_field: 327b
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 327c marc_field: 327c
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 327d marc_field: 327d
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 327e marc_field: 327e
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 327f marc_field: 327f
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 327g marc_field: 327g
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 327h marc_field: 327h
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 327i marc_field: 327i
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 328t marc_field: 328t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 410t marc_field: 410t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 411t marc_field: 411t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 412t marc_field: 412t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 413t marc_field: 413t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 421t marc_field: 421t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 422t marc_field: 422t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 423t marc_field: 423t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 424t marc_field: 424t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 425t marc_field: 425t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 430t marc_field: 430t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 431t marc_field: 431t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 432t marc_field: 432t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 433t marc_field: 433t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 434t marc_field: 434t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 435t marc_field: 435t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 436t marc_field: 436t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 437t marc_field: 437t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 440t marc_field: 440t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 441t marc_field: 441t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 442t marc_field: 442t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 443t marc_field: 443t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 444t marc_field: 444t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 445t marc_field: 445t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 446t marc_field: 446t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 447t marc_field: 447t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 448t marc_field: 448t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 451t marc_field: 451t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 452t marc_field: 452t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 453t marc_field: 453t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 454t marc_field: 454t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 455t marc_field: 455t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 456t marc_field: 456t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 461t marc_field: 461t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 462t marc_field: 462t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 463t marc_field: 463t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 464t marc_field: 464t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 470t marc_field: 470t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 481t marc_field: 481t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 482t marc_field: 482t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
- facet: '' - facet: ''
marc_field: 488t marc_field: 488t
marc_type: unimarc marc_type: unimarc
sort: 1 sort: 0
suggestible: '' suggestible: ''
opac: 1 opac: 1
staff_client: 1 staff_client: 1