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

Add indexing notes search to chant search page #1576

Merged
merged 4 commits into from
Jul 30, 2024

Conversation

lucasmarchd01
Copy link
Contributor

This PR adds functionality to the chant search page by adding the ability to search for keywords in the indexing notes of a chant. This feature is available only on the "searching in source" page. It was a relatively new feature on Old Cantus, which is why it was probably missed when re-building the new site.

Screenshot 2024-07-29 at 10 36 32 AM

Resolves #843

- ChantSearchMSView: add filtering by indexing notes to the queryset
- chant_search.html: add indexing notes search option in the form
- chant_search.js: implement form logic for indexing notes search options
- ChantSearchMSView: add filtering by indexing notes to the queryset
- chant_search.html: add indexing notes search option in the form
- chant_search.js: implement form logic for indexing notes search options
@lucasmarchd01 lucasmarchd01 changed the title Issue 843 Add indexing notes search to chant search page Jul 29, 2024
# the operation parameter can be "contains" or "starts_with"
if operation == "contains":
indexing_notes_filter = Q(indexing_notes__icontains=notes)
else:
Copy link
Contributor

Choose a reason for hiding this comment

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

My only question here is about this else, and not doing a check that the operation = "starts_with"... I'm only thinking about this in relation to the kind of thing in #1484. Is this the kind of place you are envisioning checking? Or was your thought about #1484 to do that separately.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, you're right. I completely forgot about that issue. #1484 is concerned with the actual parameter values themselves, for example if a user inputs a string type value for an expected int type. In this case, the expected value can be anything, since we are doing a text search.

I copied this logic from another part of the code and did some testing, I don't think we'll encounter the 500 error here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, great! I'm good to merge

@lucasmarchd01 lucasmarchd01 merged commit 0cf9be0 into DDMAL:develop Jul 30, 2024
1 check passed
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.

Indexing notes in "search manuscript"
2 participants