You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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?
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.
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 :)
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:

After the fix:

Changes these areas