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 find_matching_sessions function to enable keyword searching across sessions, based on metadata #864

Merged
merged 5 commits into from
Jun 20, 2024

Conversation

nonprofittechy
Copy link
Member

Adds a new function, find_matching_sessions, which can be used to search and retrieve a set of matching sessions across all unencrypted interview sessions on a server.

The expected use case is for an attorney or other advocate to be able to search through their own sessions to find a document they automated for a particular user. It can also be used in a scenario where there is a generic "intake" interview that the attorney wants to use as a starting point to automate future documents with. Search results can be limited to a particular interview or set of interviews, such as an intake questionnaire.

Searching across sessions that you did not create or were not explicitly shared is limited to 3 user roles by default: admin, developer, and advocate.

Matching is performed entirely based on keywords in the jsonstorage table; by default, only ones with the metadata key name set to "metadata." If your interview uses the Assembly Line, it automatically saves the name of the users and other_parties lists to the jsonstorage table with this key on each screen load.

Example:

matching_sessions=find_matching_sessions("smith", user_id="all", filenames=[f"{user_info().package}:intake.yml", "docassemble.MyPackage:intake.yml"])

Copy link

@samglover samglover left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@nonprofittechy nonprofittechy merged commit 4d9fc18 into main Jun 20, 2024
5 checks passed
@nonprofittechy nonprofittechy deleted the find-interview-session branch June 20, 2024 18:35
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.

2 participants