Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chang default DOI search order #1272

Merged
merged 3 commits into from
Nov 14, 2024
Merged

Chang default DOI search order #1272

merged 3 commits into from
Nov 14, 2024

Conversation

jrhoads
Copy link
Contributor

@jrhoads jrhoads commented Nov 8, 2024

Purpose

Users reported that the search results were coming back in an order they were not expecting. It turns out that the default search order had been set to the date of last update in the database. This was discussed and determined that the relevancy of the search results or _score in ES/OS should have been the default (with other sort options available if specified in the API call).

closes: datacite/datacite/issues/2206

Approach

Sets the default sort to be based on _score of search results, descending.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

  • New feature (non-breaking change which adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to change)

Reviewer, please remember our guidelines:

  • Be humble in the language and feedback you give, ask don't tell.
  • Consider using positive language as opposed to neutral when offering feedback. This is to avoid the negative bias that can occur with neutral language appearing negative.
  • Offer suggestions on how to improve code e.g. simplification or expanding clarity.
  • Ensure you give reasons for the changes you are proposing.

@jrhoads
Copy link
Contributor Author

jrhoads commented Nov 8, 2024

@codycooperross, @MaryHirsch and @KellyStathis

Are there any documentation or support implications of this change.
It makes the default sorting for the REST and GraphQL APIs based on the relevancy of the search.
I would argue that this is what is expected.

I could not find documentation on the default search sorting order when I looked. I eventually discovered in code that it had been set to the date of last update in REST (most recent first) and date of creation (oldest first) in GraphQL

@codycooperross
Copy link
Contributor

For Commons, I think this is a good change. The REST API is a little trickier, in my mind. Checking the support site, we don't specify a default sort for the REST API, though maybe others can double-check me on that. I'm having a hard time thinking of any major risks associated with changing the REST API behavior, but for current users, it may be unexpected. Open to thoughts, and I will discuss with @mariagould as well.

@codycooperross
Copy link
Contributor

@MaryHirsch @KellyStathis Has the sort order of the REST API come up in community consultations or support requests?

@MaryHirsch
Copy link

I can't think of any examples of this coming up in support.

@KellyStathis
Copy link
Collaborator

@codycooperross I agree that for current REST API users, it may be unexpected. However, I couldn't find anywhere where we documented a default sort for the REST API. I think the benefits of sorting by relevance outweigh this.

Another place to check is the DOI list sorting in Fabrica. We document that the default is Date Updated: e.g. https://support.datacite.org/docs/fabrica-member-dashboard#dois. If that's specified in the query with sort=-updated (vs. the omission of the sort parameter) then this should be unaffected; otherwise, we would need to change that to explicitly sort by date.

@jrhoads
Copy link
Contributor Author

jrhoads commented Nov 12, 2024

I ran a quick test on the staging server for Fabrica with developer tools open to the network tab. It looks like that by default when you got to the /dois page, it will send out a rest query with sort param set empty. The interface has the option to select a sort order. But by default it will send an empty sort. If the user sends a query at all in the search bar, then the sort parameter gets set to relevance.

@digitaldogsbody
Copy link
Member

It makes sense to me that we preserve the advertised Fabrica behaviour (both because it's what people are used to/is documented, but also because if there's no search, sorting by recency seems like the most useful behaviour) so we should adopt Kelly's suggestion and make the matching change in Fabrica to enforce recency sort when there is no query.

Copy link
Member

@digitaldogsbody digitaldogsbody left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy for this to be merged once Bracco has been updated to explicitly request recency sort when loading the list of DOIs for the first time

@jrhoads
Copy link
Contributor Author

jrhoads commented Nov 14, 2024

Updated Fabrica. Will merge this later today

@jrhoads jrhoads merged commit efe893b into master Nov 14, 2024
19 checks passed
@jrhoads jrhoads deleted the graph-search-order branch November 14, 2024 13:08
@jrhoads jrhoads restored the graph-search-order branch November 14, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOI search in DataCite Commons does not retrieve the exact match DOI name at the top of the list
6 participants