Search: Elasticsearch-style highlighted match snippets (results + typeahead)
CI/CD / CI · dotnet build (push) Successful in 6m9s
CI/CD / Deploy · hamkadr (push) Has been cancelled

- SearchHighlight.Snippet: extracts a ±70-char window around the first
  matching term and marks it (with ellipses) — the ES "highlight" fragment.
- Result cards (shift/job/talent) now show that snippet from the matched
  description/tags when a query is present, so you SEE where the term hit
  (e.g. «…دارای مدرک <mark>mmt</mark>…») instead of just the role.
- Typeahead suggestions gain a highlighted "sub" line (talent→tags,
  shift→city·specialty, job→facility·city) so matches show in the dropdown too.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-08 21:43:50 +03:30
parent bd8d754ee8
commit 8b0b21f24d
7 changed files with 59 additions and 7 deletions
+6 -1
View File
@@ -294,7 +294,12 @@ mark { background: #fff3bf; color: inherit; padding: 0 2px; border-radius: 3px;
.nav-search-results a:hover { background: var(--primary-soft); }
.nav-search-results .ns-type { flex: 0 0 auto; font-size: 11px; font-weight: 700; color: var(--primary-dark);
background: var(--primary-soft); border-radius: 6px; padding: 2px 7px; }
.nav-search-results .ns-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-search-results .ns-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.nav-search-results .ns-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-search-results .ns-sub { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ES-style matched snippet shown under a search-result card */
.search-snippet { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 4px 0 2px;
background: var(--bg); border-inline-start: 3px solid var(--primary-soft); padding: 5px 9px; border-radius: 6px; }
.nav-search-results .ns-all { font-weight: 700; color: var(--primary-dark); justify-content: center; }
/* Big search box on the /Search page head */
.search-hero { display: flex; gap: 8px; max-width: 640px; margin: 6px 0 4px; }