Page MenuHomePhabricator

Improve search highlighting for CJK and substring queries
ClosedPublic

Authored by epriestley on Sep 22 2017, 3:15 PM.
Tags
None
Referenced Files
F14058770: D18635.diff
Sun, Nov 17, 2:38 PM
F14053087: D18635.diff
Fri, Nov 15, 12:48 PM
F14039107: D18635.diff
Mon, Nov 11, 3:46 AM
F14032537: D18635.diff
Sat, Nov 9, 2:40 PM
F14022367: D18635.diff
Wed, Nov 6, 4:53 PM
F14008864: D18635.diff
Wed, Oct 30, 6:46 AM
F14005508: D18635.diff
Sun, Oct 27, 2:26 PM
F13968091: D18635.id44742.diff
Oct 16 2024, 6:30 PM
Subscribers
None

Details

Summary

Fixes T12995. Currently, the result highlighter (which shows where terms matched) only works in "term" mode, not in "substring" mode.

Provide better feedback and behvaior:

  • When a term is a substring term, color it a little differently and add a tooltip. (This is partly to make it easier to debug/diagnose things, probably not enormously valuable to users.)
  • When a term is a substring term, highlight it anywhere in the results.
Test Plan

Queried for latin and CJK terms.

Here is CJK being highlighted:

Screen Shot 2017-09-22 at 8.08.26 AM.png (661×550 px, 56 KB)

Here is substring vs non-substring implicit behavior:

Screen Shot 2017-09-22 at 8.08.34 AM.png (490×515 px, 36 KB)

Here's ONLY terms being highlighted:

Screen Shot 2017-09-22 at 8.09.57 AM.png (570×523 px, 51 KB)

Here's terms and substrings, since the query now has a substring:

Screen Shot 2017-09-22 at 8.10.01 AM.png (579×539 px, 54 KB)

Diff Detail

Repository
rP Phabricator
Branch
high1
Lint
Lint Passed
SeverityLocationCodeMessage
Advicesrc/applications/search/view/PhabricatorSearchResultView.php:87XHP14Misuse of `preg_quote`
Advicesrc/applications/search/view/PhabricatorSearchResultView.php:90XHP14Misuse of `preg_quote`
Unit
Tests Passed
Build Status
Buildable 18520
Build 24944: Run Core Tests
Build 24943: arc lint + arc unit

Event Timeline

Looks good (minus nit), assuming lint is a false positive.

src/applications/search/view/PhabricatorSearchResultView.php
130

"correctly"

This revision is now accepted and ready to land.Sep 22 2017, 6:08 PM
  • Use more conventional grammar.
This revision was automatically updated to reflect the committed changes.