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 19, 2023
1 parent 770dc5e commit 0bef27a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions rero_ils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2495,7 +2495,7 @@ def _(x):
default_order='asc'
)
RECORDS_REST_SORT_OPTIONS['items']['enumeration_chronology'] = dict(
fields=['-enumerationAndChronology'], title='Enumeration and Chronology',
fields=['-enumerationAndChronology.sort'], title='Enumeration and Chronology',
default_order='desc'
)
RECORDS_REST_SORT_OPTIONS['items']['library'] = dict(
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 0bef27a

Please sign in to comment.