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

Advanced search fixes #1813

Merged
merged 5 commits into from
May 15, 2024
Merged

Advanced search fixes #1813

merged 5 commits into from
May 15, 2024

Conversation

longhotsummer
Copy link
Contributor

@longhotsummer longhotsummer commented May 14, 2024

  • build the search query field-by-field, so that it's correct
  • don't mix simple and advanced search for "all" field queries; so advanced search now has search__all; this means we can apply stricter match requirements
  • adjust field chooser so that the user can't choose no fields, or all + other fields
  • advanced search on the "content" field must search content, pages and provisions

Closes #1795

https://www.loom.com/share/e0e891516fdd488cab852e9ca663c387

There is still a problem with negative queries on pages or legislation with provisions. Because each provision/page is indexed and search individually, it's possible to have a search dog -cat that returns a document with cat in it, because it'll match pages or provisions that have dog but not cat.

So for negative searches we actually need to index and search the full content, not on a per-page or per-provision basis.

for search__content, we must search: content, pages.body, and
provisions.body
otherwise, we can't tell when to do a broad search vs an advanced search
if we don't have explicit search fields
@longhotsummer
Copy link
Contributor Author

I've opened #1815 for the negative search issue

Copy link
Contributor

@actlikewill actlikewill left a comment

Choose a reason for hiding this comment

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

awesome. works well
I think this also closes laws-africa/kenyalaw-pj#62

@longhotsummer longhotsummer merged commit 2371f58 into main May 15, 2024
9 checks passed
@longhotsummer longhotsummer deleted the advanced-search branch May 15, 2024 08:51
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.

Advanced search: Investigate and Implement all keywords option for cross-field search
2 participants