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

Allow searching text for study name and description #1068

Merged
merged 6 commits into from
Oct 20, 2023

Conversation

naglepuff
Copy link
Collaborator

@naglepuff naglepuff commented Oct 18, 2023

Fix #965
Fix #1071

This PR adds some additional query options when using the text search bar, as well as establishes a framework for including more in the future. For this iteration, we have added plaintext searching for:

title of Study
description of Study
name of Study

In order to accomplish this, our DSL query language has been updated to support using the SQL ilike function. This was a straightforward change for properties represented directly as columns on the study table, but required some additional work for values stored in the annotation column (JSON).

There is also a new CLI command, nmdc-server create-or-replace-nmdc-functions which updates the custom NMDC functions used for ingest and search at a whim, rather than relying on the SQLAlchemy event system. See linked issue #1071 for some additional details.

Updating these functions is also folded into the nmdc-server migrate command, which is invoked in our prestart script. This should populate the needed function when the app spins up.

@naglepuff naglepuff marked this pull request as ready for review October 20, 2023 16:53
Copy link
Collaborator

@jeffbaumes jeffbaumes left a comment

Choose a reason for hiding this comment

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

I left a comment about the existing listen statement but this all looks great to me.

nmdc_server/database.py Show resolved Hide resolved
@naglepuff naglepuff merged commit 75e850a into main Oct 20, 2023
2 checks passed
@naglepuff naglepuff deleted the 965-text-search-fields branch October 20, 2023 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants