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

Get Collection Items extension - facets - filter queries - sort/type #230

Merged

Conversation

g-saracca
Copy link
Contributor

What this PR does / why we need it:

Extends the Get Collection Items use case.
Now returns the facets according to the search.
Also now accepts 3 more properties in the CollectionSearchCriteria - sort, order and filterQueries.
sort: 'name' or 'date'
type: 'asc' or 'desc'
filterQueries: an strings Array of type string:string

Which issue(s) this PR closes:

Suggestions on how to test this:

Visual code inspection and run tests.

Is there a release notes update needed for this change?:

No

@g-saracca g-saracca added Size: 3 A percentage of a sprint. 2.1 hours. GREI Re-arch GREI re-architecture-related Original size: 3 SPA.Q4.1 Collection Page: All Filtering Options FY25 Sprint 12 FY25 Sprint 12 (2024-12-04 - 2024-12-18) labels Dec 9, 2024
@g-saracca g-saracca changed the title Feat/229 get collection items extension facets filter sort Get Collection Items extension - facets - query filters - sort/type Dec 9, 2024
@g-saracca g-saracca changed the title Get Collection Items extension - facets - query filters - sort/type Get Collection Items extension - facets - filter queries - sort/type Dec 9, 2024
@g-saracca g-saracca self-assigned this Dec 9, 2024
@g-saracca g-saracca assigned g-saracca and unassigned g-saracca Dec 9, 2024
@g-saracca g-saracca removed their assignment Dec 10, 2024
@ekraffmiller ekraffmiller self-assigned this Dec 10, 2024
Copy link
Contributor

@ekraffmiller ekraffmiller left a comment

Choose a reason for hiding this comment

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

Looks great, I just have some minor comments below

@g-saracca
Copy link
Contributor Author

@ekraffmiller all changes addressed, thanks for the review!

@g-saracca g-saracca removed their assignment Dec 12, 2024
Copy link
Contributor

@ekraffmiller ekraffmiller left a comment

Choose a reason for hiding this comment

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

looks good, approved!

@ekraffmiller
Copy link
Contributor

ekraffmiller commented Dec 16, 2024

@g-saracca I realized there is one more change needed, there is a sort type "Relevance" used when the CollectionSearchCriteria contains search text. For the API, sort=score. For example:

Screenshot 2024-12-17 at 8 01 21 AM

I'm going to put the PR back to InReview, sorry about that.

@g-saracca
Copy link
Contributor Author

g-saracca commented Dec 17, 2024

Hi @ekraffmiller , in the api endpoint docs there is nothing about sort by relevance, there is show_relevance but it's for something different. Sort can be date or name and Order asc or desc, but nothing about relevance.
Perhaps we need to extend the api endpoint to achieve that but maybe we can continue without that and do it in another issue after the api extension is done.

https://guides.dataverse.org/en/latest/api/search.html

@ekraffmiller
Copy link
Contributor

Ah ok, so when the user chooses sort by relevance, that is the same as doing a text search without a sort option. Makes sense, I don't think we need to update the API, I was just confused by the url params in the frontend.

@g-saracca g-saracca removed their assignment Dec 17, 2024
@g-saracca
Copy link
Contributor Author

g-saracca commented Dec 17, 2024

Right, when you search something the url looks like this:
https://beta.dataverse.org/dataverse/root/?q=foo
And when clicking Sort By Releveance the url turns to this:
https://beta.dataverse.org/dataverse/root?q=foo&types=dataverses%3Adatasets%3Afiles&page=1&sort=score&order=desc

@g-saracca g-saracca assigned g-saracca and unassigned g-saracca Dec 17, 2024
@ofahimIQSS ofahimIQSS self-assigned this Dec 18, 2024
@ofahimIQSS
Copy link
Contributor

Tests are passing - Merging PR

@ofahimIQSS ofahimIQSS merged commit d6708f3 into develop Dec 18, 2024
5 checks passed
@ofahimIQSS ofahimIQSS deleted the feat/229-get-collection-items-extension-facets-filter-sort branch December 18, 2024 15:12
@ofahimIQSS ofahimIQSS removed their assignment Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FY25 Sprint 12 FY25 Sprint 12 (2024-12-04 - 2024-12-18) GREI Re-arch GREI re-architecture-related Original size: 3 Size: 3 A percentage of a sprint. 2.1 hours. SPA.Q4.1 Collection Page: All Filtering Options
Projects
Status: Done 🧹
Development

Successfully merging this pull request may close these issues.

Get Collection Items use case extension
3 participants