Skip to content

Feature/vulcan search #7

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

Merged
merged 9 commits into from
Apr 8, 2025
Merged

Feature/vulcan search #7

merged 9 commits into from
Apr 8, 2025

Conversation

XanderVertegaal
Copy link

@XanderVertegaal XanderVertegaal commented Jan 9, 2025

Close #6
Close #8

This PR fixes the search functionality in Vulcan and adds utilities to handle timestamps.

This relies on the feature/vulcan-search branch of the main ParsePort repo.

The Vulcan frontend features quite an involved menu structure that lets the user construct SearchFilters, which can be used to filter certain results (e.g. only show sentences that involve the word 'cat').

Whenever the Websocket server receives the perform_search signal, it retrieves the Layout the user is currently looking at, takes the SearchFilters that are sent along with the signal and applies them to the Layout, creating a new Layout representing the search result. This new Layout is stored in the database under a new unique identifier and a reference to its 'base' Layout. The identifier is sent to the client, triggering a redirect to the new Layout with the search results. If the user hits Clear Search, the old 'base' Layout is returned. Having unique identifiers for search results means that researchers can send search results to their peers simply by sharing the URL.

To avoid that the DB gets cluttered over time with old, unused Layouts, I've added a script remove_old_layouts.py. The idea is that this script is run once a day (or less often) to clean up old Layouts that haven't been used for 90 days. Of course, we can increase the expiry date to 365 days or to whatever the researcher would like.

Still to be done: if you open the URL of a Layout that represents a search result, you see the filtered corpus, but the search menu remains empty, so you cannot see the parameters used to perform the search. I've set up a meeting with the original author of Vulcan to discuss this.

Edit: the developer of Vulcan and I discussed this, and it was easier than I feared! Search params are now restored :)

@XanderVertegaal XanderVertegaal linked an issue Jan 20, 2025 that may be closed by this pull request
Copy link

@Meesch Meesch left a comment

Choose a reason for hiding this comment

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

In terms of code, this is ready to merge, good job. In terms of functionality, I am a little concerned about how opaque the navigation within search results functions... Firstly, it is currently impossible to see how many 'layers' deep you are within a search, which opens the door to potentiallly missed results for the researcher. Moreover, I think it is not logical behavior that when you are in a search result and change the original search filter, it does not change the underlying filter, but instead creates a new filter on top of the existing one. And this while there is already functionality to add several filters. However, there are various ways of implementing this, so let's discuss next week!

Base automatically changed from feature/db-init to develop April 5, 2025 14:51
@XanderVertegaal
Copy link
Author

The last commit gets rid of the confusing layering structure whereby search are based off one another. Now, every new search is based on the 'standard Layout', and we don't store the IDs of other 'base' Layouts anymore.

@XanderVertegaal XanderVertegaal requested a review from Meesch April 8, 2025 14:19
Copy link

@Meesch Meesch left a comment

Choose a reason for hiding this comment

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

Beautiful. Saving d757470 for when I need a little pick-me-up. Simplified search structure is very nice.

@XanderVertegaal
Copy link
Author

Great suggestion to modify the search function! This makes using the search interface a lot more intuitive! <3

@XanderVertegaal XanderVertegaal deleted the feature/vulcan-search branch April 8, 2025 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

DB cleanup and timestamp renewal
2 participants