Skip to content

Commit

Permalink
global: improved indexing, data flow and search
Browse files Browse the repository at this point in the history
* Refactors data flow and indexing so that the aggregate data model is
  in charge of all data parsing of the user and role model as well as
  indexing

* Adds domain data and user identities and further attributes to the
  users index and makes them searchable for admins.

* Fixes indexing/facets of email domain values.

* Allows admins to search for restricted email addresses.

* Add admin facets for domain, account status, domain status.

* Add sort options to admin user search.
  • Loading branch information
lnielsen committed Feb 19, 2024
1 parent 62ddc16 commit cb7a27c
Show file tree
Hide file tree
Showing 18 changed files with 1,134 additions and 326 deletions.
60 changes: 45 additions & 15 deletions invenio_users_resources/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,36 +48,54 @@
"""Schema used by the users service."""

USERS_RESOURCES_SEARCH = {
"sort": [
"email",
"username",
"email_domain",
],
"facets": ["email_domain", "affiliations"],
"sort": ["bestmatch", "username", "email", "domain", "newest", "oldest", "updated"],
"facets": ["status", "visibility", "domain_status", "domain", "affiliations"],
}
"""User search configuration (i.e list of banners)."""
"""User search configuration."""

USERS_RESOURCES_SORT_OPTIONS = {
"bestmatch": dict(
title=_("Best match"),
fields=["_score"],
),
"username": dict(
title=_("Username"),
fields=["username"],
fields=["username", "-created"],
),
"email": dict(
title=_("Email"),
fields=["email"],
fields=["email_hidden", "-created"],
),
"domain": dict(
title=_("Domain"),
fields=["domain", "-created"],
),
"newest": dict(
title=_("Newest"),
fields=["-created"],
),
"oldest": dict(
title=_("Oldest"),
fields=["created"],
),
"email_domain": dict(
title=_("Email domain"),
fields=["email.domain"],
"updated": dict(
title=_("Recently updated"),
fields=["-updated"],
),
}
"""Definitions of available Users sort options. """

USERS_RESOURCES_SEARCH_FACETS = {
"email_domain": {
"facet": facets.email_domain,
"domain": {
"facet": facets.domain,
"ui": {
"field": "domain",
},
},
"domain_status": {
"facet": facets.domain_status,
"ui": {
"field": "email.domain",
"field": "domain_status",
},
},
"affiliations": {
Expand All @@ -86,6 +104,18 @@
"field": "profile.affiliations.keyword",
},
},
"status": {
"facet": facets.status,
"ui": {
"field": "status",
},
},
"visibility": {
"facet": facets.visibility,
"ui": {
"field": "visibility",
},
},
}
"""Invenio requests facets."""

Expand Down
Loading

0 comments on commit cb7a27c

Please sign in to comment.