Skip to content

Commit

Permalink
search: sort by title
Browse files Browse the repository at this point in the history
* documents/series/items/eitems can be sorted by their title
* see inveniosoftware/react-invenio-app-ils#111
  • Loading branch information
FlorianCassayre authored and kpsherva committed Jul 30, 2020
1 parent c3221ca commit 99a3fa5
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 8 deletions.
24 changes: 24 additions & 0 deletions invenio_app_ils/config.py
Expand Up @@ -691,6 +691,12 @@ def _(x):
default_order="desc",
order=5,
),
title=dict(
fields=["title.keyword"],
title="Title",
default_order="asc",
order=6
)
),
eitems=dict( # ItemSearch.Meta.index
mostrecent=dict(
Expand All @@ -702,6 +708,12 @@ def _(x):
default_order="asc",
order=2,
),
title=dict(
fields=["document.title.keyword"],
title="Title",
default_order="asc",
order=3
)
),
items=dict( # ItemSearch.Meta.index
mostrecent=dict(
Expand All @@ -713,6 +725,12 @@ def _(x):
default_order="asc",
order=2,
),
title=dict(
fields=["document.title.keyword"],
title="Title",
default_order="asc",
order=3
)
),
patrons=dict( # PatronsSearch.Meta.index
bestmatch=dict(
Expand All @@ -732,6 +750,12 @@ def _(x):
default_order="asc",
order=2,
),
title=dict(
fields=["title.keyword"],
title="Title",
default_order="asc",
order=3
)
),
)

Expand Down
Expand Up @@ -458,7 +458,12 @@
"type": "keyword"
},
"title": {
"type": "text"
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"updated_by": {
"properties": {
Expand Down
Expand Up @@ -457,7 +457,12 @@
"type": "keyword"
},
"title": {
"type": "text"
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"updated_by": {
"properties": {
Expand Down
7 changes: 6 additions & 1 deletion invenio_app_ils/eitems/mappings/v6/eitems/eitem-v1.0.0.json
Expand Up @@ -31,7 +31,12 @@
"type": "keyword"
},
"title": {
"type": "text"
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
}
},
"type": "object"
Expand Down
7 changes: 6 additions & 1 deletion invenio_app_ils/eitems/mappings/v7/eitems/eitem-v1.0.0.json
Expand Up @@ -30,7 +30,12 @@
"type": "keyword"
},
"title": {
"type": "text"
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
}
},
"type": "object"
Expand Down
7 changes: 6 additions & 1 deletion invenio_app_ils/items/mappings/v6/items/item-v1.0.0.json
Expand Up @@ -72,7 +72,12 @@
"type": "keyword"
},
"title": {
"type": "text"
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
}
},
"type": "object"
Expand Down
7 changes: 6 additions & 1 deletion invenio_app_ils/items/mappings/v7/items/item-v1.0.0.json
Expand Up @@ -74,7 +74,12 @@
"type": "keyword"
},
"title": {
"type": "text"
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
}
},
"type": "object"
Expand Down
7 changes: 6 additions & 1 deletion invenio_app_ils/series/mappings/v6/series/series-v1.0.0.json
Expand Up @@ -219,7 +219,12 @@
}
},
"title": {
"type": "text"
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"updated_by": {
"properties": {
Expand Down
7 changes: 6 additions & 1 deletion invenio_app_ils/series/mappings/v7/series/series-v1.0.0.json
Expand Up @@ -216,7 +216,12 @@
"type": "object"
},
"title": {
"type": "text"
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"updated_by": {
"properties": {
Expand Down

0 comments on commit 99a3fa5

Please sign in to comment.