Skip to content

Commit

Permalink
items: sorting for standard holdings
Browse files Browse the repository at this point in the history
Items sorting on standard holdings takes into consideration the numerical
values in the character string.

* Closes rero#2243.
* Fixes noquery configuration on items sort.

⚠️  migration: items reindexing.

Co-Authored-by: Bertrand Zuchuat <[email protected]>
  • Loading branch information
Garfield-fr committed Sep 20, 2023
1 parent 770dc5e commit e4a15bf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions rero_ils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2495,8 +2495,8 @@ def _(x):
default_order='asc'
)
RECORDS_REST_SORT_OPTIONS['items']['enumeration_chronology'] = dict(
fields=['-enumerationAndChronology'], title='Enumeration and Chronology',
default_order='desc'
fields=['enumerationAndChronology.sort'], title='Enumeration and Chronology',
default_order='asc'
)
RECORDS_REST_SORT_OPTIONS['items']['library'] = dict(
fields=['library.pid'], title='Library',
Expand All @@ -2509,7 +2509,7 @@ def _(x):
)

RECORDS_REST_DEFAULT_SORT['items'] = dict(
query='bestmatch', noquery='enum_chronology')
query='bestmatch', noquery='enumeration_chronology')

# ------ ITEM TYPES SORT
RECORDS_REST_SORT_OPTIONS['item_types']['name'] = dict(
Expand Down
9 changes: 8 additions & 1 deletion rero_ils/modules/items/mappings/v7/items/item-v0.0.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@
}
},
"enumerationAndChronology": {
"type": "keyword"
"type": "keyword",
"fields": {
"sort": {
"type": "icu_collation_keyword",
"index": false,
"numeric": true
}
}
},
"location": {
"properties": {
Expand Down

0 comments on commit e4a15bf

Please sign in to comment.