-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: sort and search by language/name on edit page #159
base: develop
Are you sure you want to change the base?
Conversation
- Support sort by language - Support sort by name - Support search by language Refs: #137
|
||
if search_query: | ||
instrument_names = instrument_names.filter(language__en_label__icontains=search_query) | ||
|
||
instrument_names = instrument_names.order_by(sort_by) | ||
context["instrument_names"] = instrument_names |
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.
We have a solr set-up for UMIL... let's use that for search!
Lemme know if you want some examples for how to set this up.
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.
Yes, some example would be great!
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.
Ok, a few things would be helpful:
- The solr admin panel is location at port 8983 (so in development at localhost:8983). One of the more useful areas of this for debugging search applications is the
Query
section. In the drop-down on the left, you'll see thevirtual-instrument-museum
core. Select that one, and then in the panel that appears you can go toQuery
to get a UI for making solr queries. Useful for debugging queries. - An example from Cantus Ultimus: we use this view to query solr to provide search suggestions: https://github.com/DDMAL/cantus/blob/main/app/public/cantusdata/views/suggestion.py. The view is pretty simple: building a request to the solr server and then making it with the requests package.
- I don't have an example of this, but if you wanted to perform the search without routing through a Django view, you could just make the request via Javascript to the solr server (eg. have the browser request to an endpoint that your route to the solr server using the nginx configurations and then unpack the json response in the client).
@zhannaklimanova Sorry for not letting you know in time. But we don't need a "instrument detail" page anymore. Instead, we only need modals for "upload image" and "add instrument name" on the "instrument list" page. You can see the issues #150 and #157 for reference. But don't worry because I think the search and sort features may still be needed on the "instrument list" page. You may see a "Search..." on the top of the "instrument list" page. If you have any questions about the current progress of UMIL, please feel free to ask me. |
@kunfang98927 So do we delete issue #137 which corresponds to this pull request and I can instead implement the solr search and sort functionality on the instrument list page instead of the individual edit pages? |
@zhannaklimanova Yes, I think you can just edit the title of issue #137 and implement search and sort for instrument list page. |
Refs: #137
Sort by Name
Sort by Language
Search by Language