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

Text Search and Filters don't work at the same time in the web UI #1316 #1333

Merged
merged 4 commits into from
May 7, 2024

Conversation

neel-suthar
Copy link

@neel-suthar neel-suthar commented Jan 21, 2024

Making sure to return distinct results. Changing set operation to '&' to show the matching results from filters AND search term

Fixes: #1316

Summary

The fix involves adjusting the combination of filter and search results to avoid duplicates. Instead of using the "or" (|) operation, consider using a method that ensures the snapshots appearing in the result set satisfy both the filter conditions and the search term. This adjustment aims to eliminate duplicate entries in the combined result.

Before the fix:
image

After the fix:
image

Changes these areas

  • Bugfixes
  • Feature behavior
  • Command line interface
  • Configuration options
  • Internal architecture
  • Snapshot data layout on disk

…hiveBox#1316

Making sure to return distinct results. Changing set operation to '&' to show the matching results from filters AND search term
@neel-suthar
Copy link
Author

@pirate Please review.

@pirate
Copy link
Member

pirate commented Jan 23, 2024

I'm worried that while this enables filters working, it will hide some results that only match via external backend search index but dont match via SQLite db field search (or vice-versa).

e.g. if user searches for some string that's only present in a tag, but not in the snapshot content

Maybe better to extract the filter parameters passed from the UI and apply them to the queryset manually?

@neel-suthar
Copy link
Author

Interesting. I thought the search results would contain that information. So when we do perform & operation the final set would have the results matching both. Let me go through the code and figure it out. Thanks.

@pirate pirate marked this pull request as draft April 24, 2024 23:24
archivebox/core/mixins.py Outdated Show resolved Hide resolved
@pirate pirate marked this pull request as ready for review May 7, 2024 06:14
@pirate pirate merged commit ce42472 into ArchiveBox:dev May 7, 2024
2 checks passed
@pirate
Copy link
Member

pirate commented May 7, 2024

I merged just the .distinct() fix for now, happy to review other PRs in the future for other changes, though lets discuss them in an issue first to make sure all the use cases are handled :)

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.

Text Search and Filters don't work at the same time in the web UI
2 participants