-
Notifications
You must be signed in to change notification settings - Fork 44
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
Circulars Sort Results by Relevance #1829
Circulars Sort Results by Relevance #1829
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice idea. Would you please add a dropdown menu that switches between sort by circular ID and relevance?
also renamed some of the sort variables
very very rough version of a UI button for selecting the sort method. defaults to sorting by circularID but can be changed to relevance. partial implementation of a sort order, but that needs to be implemented in the button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Remove commented out code
- Use radio buttons instead of links
- Don't manually construct the query string; the values of the radio buttons will automatically be included in the form request on submission
- Let's not add support for selecting sort order right now; there's no reason to support sorting by decreasing relevance.
app/routes/_gcn.circulars._archive._index/SortSelectorButton.tsx
Outdated
Show resolved
Hide resolved
app/routes/_gcn.circulars._archive._index/SortSelectorButton.tsx
Outdated
Show resolved
Hide resolved
app/routes/_gcn.circulars._archive._index/SortSelectorButton.tsx
Outdated
Show resolved
Hide resolved
using same implementation as pr nasa-gcn#1856 to remove hard-coding of form id in route.tsx as well.
app/routes/_gcn.circulars._archive._index/SortSelectorButton.tsx
Outdated
Show resolved
Hide resolved
app/routes/_gcn.circulars._archive._index/SortSelectorButton.tsx
Outdated
Show resolved
Hide resolved
app/routes/_gcn.circulars._archive._index/SortSelectorButton.tsx
Outdated
Show resolved
Hide resolved
app/routes/_gcn.circulars._archive._index/SortSelectorButton.tsx
Outdated
Show resolved
Hide resolved
app/routes/_gcn.circulars._archive._index/SortSelectorButton.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Leo Singer <[email protected]>
fix merge
app/routes/_gcn.circulars._archive._index/SortSelectorButton.tsx
Outdated
Show resolved
Hide resolved
app/routes/_gcn.circulars._archive._index/SortSelectorButton.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Leo Singer <[email protected]>
accidentally removed when fixing merge conflict
app/routes/_gcn.circulars._archive._index/SortSelectorButton.tsx
Outdated
Show resolved
Hide resolved
app/routes/_gcn.circulars._archive._index/SortSelectorButton.tsx
Outdated
Show resolved
Hide resolved
app/routes/_gcn.circulars._archive._index/SortSelectorButton.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Leo Singer <[email protected]>
made sortOptions keyed by value and then switched the way the mapping worked when generating the radio buttons as a result. Changed label for Circular ID option to date. backend still uses circularID, however
the failing check seems to be a network error? |
app/routes/_gcn.circulars._archive._index/SortSelectorButton.tsx
Outdated
Show resolved
Hide resolved
app/routes/_gcn.circulars._archive._index/SortSelectorButton.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Leo Singer <[email protected]>
sort selection input is now sanitized such that the SortSelector function checks that the provided value in the url is a key of the sortOptions object. If it is not, the value defaults to sorting by the date.
Currently, searching for circulars sorts by circular ID (ie newest to oldest), but it's also possible to sort by relevance; I'm unsure if it would be better to sort by relevance once we implement the NLP search functionality
Searching 'GRB' and sorting by ID:
Searching 'GRB' and sorting by relevance:
There's some balance to be made between showing the most relevant results and also weighting the most recent results, since they're arguably the circulars users are more likely to search for.
Another option would be to default to relevance and have the option to sort by circular ID if a toggle is set; this could be accomplished using the sortable tables, which I've been experimenting with in #1816