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

Feature/search uhighlighter #2732

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

idodeclare
Copy link
Contributor

Hello,

Please consider for integration this patch to add HitFormatter to extend OGKUnifiedHighlighter for use by SearchEngine.

There are some known, pending migrations to uhighlight remaining in OpenGrok. Hit generation was one area, and HistoryContext continues to be a legacy highlighter.

@wy193777 requested in #2612 that search results not be HTML-ized. This patch mostly addresses the request by enhancing SearchEngine to return code-matching results for full|defs|refs and to add substring offsets to the Hit results in lieu of the former HTML-emphasis.

hist searches will still return legacy, HTML-fragment results via HistoryContext.

For testing, I uncommented SearchEngineTest.testSearch() but set it to @Ignore. The test is still useful even with its race condition bugs.

Thank you.

(@vladak, I see you're squash-merging again; please may I ask you don't subject my PRs to that.)

@coveralls
Copy link

coveralls commented Mar 25, 2019

Pull Request Test Coverage Report for Build 5465

  • 45 of 193 (23.32%) changed or added relevant lines in 9 files are covered.
  • 7 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.1%) to 75.566%

Changes Missing Coverage Covered Lines Changed/Added Lines %
opengrok-indexer/src/main/java/org/opengrok/indexer/search/Results.java 0 2 0.0%
opengrok-indexer/src/main/java/org/opengrok/indexer/search/Hit.java 8 13 61.54%
opengrok-web/src/main/java/org/opengrok/web/api/v1/controller/SearchController.java 0 7 0.0%
opengrok-indexer/src/main/java/org/opengrok/indexer/search/SearchFormatterBase.java 13 27 48.15%
opengrok-indexer/src/main/java/org/opengrok/indexer/search/context/OGKUnifiedHighlighter.java 1 25 4.0%
opengrok-indexer/src/main/java/org/opengrok/indexer/search/SearchEngine.java 13 41 31.71%
opengrok-indexer/src/main/java/org/opengrok/indexer/search/HitFormatter.java 0 32 0.0%
opengrok-indexer/src/main/java/org/opengrok/indexer/search/context/Context.java 7 43 16.28%
Files with Coverage Reduction New Missed Lines %
opengrok-indexer/src/main/java/org/opengrok/indexer/search/Hit.java 1 85.71%
opengrok-web/src/main/java/org/opengrok/web/api/v1/controller/SearchController.java 1 25.4%
opengrok-indexer/src/main/java/org/opengrok/indexer/configuration/IndexTimestamp.java 2 42.86%
opengrok-indexer/src/main/java/org/opengrok/indexer/search/SearchEngine.java 3 52.02%
Totals Coverage Status
Change from base Build 5462: -0.1%
Covered Lines: 41358
Relevant Lines: 54731

💛 - Coveralls

@vladak
Copy link
Member

vladak commented Mar 25, 2019

Don't worry about squashing the changesets. I am well aware you craft the csets carefully. In general I squash only csets that are not of value w.r.t. history like small code review induced changes.

@tarzanek tarzanek added this to the 1.2 milestone Mar 28, 2019
@tarzanek tarzanek requested a review from ahornace June 25, 2019 10:06
@ahornace ahornace modified the milestones: 1.2, 1.4 Aug 5, 2019
@idodeclare
Copy link
Contributor Author

Rebased with no conflicts

@idodeclare
Copy link
Contributor Author

Rebased with just a conflict in a SearchEngineTest.java import due to #2983.

@idodeclare
Copy link
Contributor Author

Rebased with just conflicts in copyright text.

@idodeclare
Copy link
Contributor Author

@tarzanek , please would you take a look at this one if you get some time?

@tarzanek
Copy link
Contributor

tarzanek commented May 5, 2020

I just merged #3130 , thank you for that
which means I broke this

I will try to review and sorry for delays

@tarzanek
Copy link
Contributor

tarzanek commented May 5, 2020

@ahornace will you have time to have a quick look at this too?

@idodeclare idodeclare force-pushed the feature/search_uhighlighter branch from f10f0f1 to ccc5e17 Compare May 5, 2020 17:25
@idodeclare
Copy link
Contributor Author

Just rebased on master to resolve conflicts from #3130, which had been extracted from this patch.

- path, filename, and directory are now immutable,
  so require initialization
Addresses the source-code related part of oracle#2612
since `OGKUnifiedHighlighter` allows straight-
forward, alternate formatters.

`HistoryContext` is still a custom highlighting,
so it will still return HTML-like content.
@vladak vladak removed this from the 1.4 milestone Apr 9, 2021
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.

None yet

5 participants