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

Fix comment search highlight + multi-word search #2542

Merged
merged 2 commits into from
Jan 27, 2023
Merged

Fix comment search highlight + multi-word search #2542

merged 2 commits into from
Jan 27, 2023

Conversation

shamoon
Copy link
Member

@shamoon shamoon commented Jan 27, 2023

Proposed change

Fixes the issue with searching for multi-word comments and fixes some issues that can with comment search highlighting.

Comment searching has proved to be a bit more complicated than I realized, honestly mostly because I find the whoosh docs to be opaque, but thats on me. The fix here is mostly to let whoosh handle the highlighting on its own instead of trying to mess with it. I also took the opportunity to allow for visual highlighting more than one comment. See screenshots of all

Screen Shot 2023-01-27 at 10 28 39 AM

Screen Shot 2023-01-27 at 10 01 22 AM

Screen Shot 2023-01-27 at 10 01 15 AM

Fixes #2536

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other (please explain)

Checklist:

  • I have read & agree with the contributing guidelines.
  • If applicable, I have tested my code for new features & regressions on both mobile & desktop devices, using the latest version of major browsers.
  • If applicable, I have checked that all tests pass, see documentation.
  • I have run all pre-commit hooks, see documentation.
  • I have made corresponding changes to the documentation as needed.
  • I have checked my modifications for any breaking changes.

@shamoon shamoon requested review from a team as code owners January 27, 2023 18:33
@paperless-ngx-secretary paperless-ngx-secretary bot added backend frontend non-trivial Requires approval by several team members labels Jan 27, 2023
@github-actions github-actions bot added the bug Bug report or a Bug-fix label Jan 27, 2023
@shamoon shamoon added this to the v1.12.2 milestone Jan 27, 2023
@shamoon shamoon linked an issue Jan 27, 2023 that may be closed by this pull request
@coveralls
Copy link

coveralls commented Jan 27, 2023

Pull Request Test Coverage Report for Build 4027216755

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 10 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.01%) to 92.737%

Files with Coverage Reduction New Missed Lines %
documents/views.py 10 95.3%
Totals Coverage Status
Change from base Build 4026976752: 0.01%
Covered Lines: 5554
Relevant Lines: 5989

💛 - Coveralls

Copy link
Member

@stumpylog stumpylog left a comment

Choose a reason for hiding this comment

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

I also find Whoosh to be difficcult reading.

@shamoon shamoon merged commit d2b290f into dev Jan 27, 2023
@shamoon shamoon deleted the fix-2536 branch January 27, 2023 19:08
@github-actions
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backend bug Bug report or a Bug-fix frontend non-trivial Requires approval by several team members
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[BUG] Multi-word comment search strings not working in 1.12.1
3 participants