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 bill type matches to tag search results #1027

Merged
merged 3 commits into from
Oct 11, 2023
Merged

Add bill type matches to tag search results #1027

merged 3 commits into from
Oct 11, 2023

Conversation

antidipyramid
Copy link
Collaborator

@antidipyramid antidipyramid commented Oct 4, 2023

Overview

See title.

Connects #1026

Notes

The tags displayed below a search result:

Screen Shot 2023-10-04 at 1 10 44 PM

include not only formal "topics" but also locations, programs, policies, bill types, etc.

I think it would be a good idea to match users' tag searches over all of those values. We could add a combined tags field to the search index to easily query tags with sqs.filter(tags__in=[search_term]).

Testing Instructions

  • Search for a bill type (e.g. Informational Report)
  • Click Tag search
  • Verify that this yields all matching bill types
  • Verify that a tag search for a topic and a bill type works as expected

@antidipyramid antidipyramid requested a review from hancush October 4, 2023 17:19
lametro/forms.py Outdated
@@ -68,7 +68,7 @@ def _topic_search(self, sqs):

topic_filter = SQ()
for term in terms:
topic_filter &= SQ(topics__in=[term])
topic_filter &= SQ(topics__in=[term]) | SQ(bill_type__in=[term])
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it would be a good idea to match users' tag searches over all of those values.

This is a great idea. As a stopgap to the combined index field, could we update this query to search all of the fields you mention?

@antidipyramid antidipyramid requested a review from hancush October 6, 2023 20:56
Copy link
Collaborator

@hancush hancush left a comment

Choose a reason for hiding this comment

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

Thanks! Let's get this important fix up on the live site.

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