-
Notifications
You must be signed in to change notification settings - Fork 149
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
[ACS-6427] Add search highlighting #3637
Conversation
const { name, properties } = this.node.entry; | ||
const title = properties ? properties['cm:title'] : ''; | ||
|
||
const highlights: SearchEntryHighlight[] = this.node.entry['search']?.['highlight']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it would be good idea to update model to have search and highlight fields defined inside models? Thanks that we won't need to do some workarounds with [] and IDE will hint available fields.
Not sure if that is easy to update and if that is possible so if not in that PR we can also raise task for that. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically ResultSetRowEntry
contains search properties but the component itself needs regular node to pass it to subsequent methods accepting node only, and node itself shouldn't contain the search properties imo @DenysVuika what do you think?
...cts/aca-content/src/lib/components/search/search-results-row/search-results-row.component.ts
Outdated
Show resolved
Hide resolved
...cts/aca-content/src/lib/components/search/search-results-row/search-results-row.component.ts
Outdated
Show resolved
Hide resolved
...cts/aca-content/src/lib/components/search/search-results-row/search-results-row.component.ts
Show resolved
Hide resolved
@@ -46,6 +46,8 @@ import { MatDialogModule } from '@angular/material/dialog'; | |||
host: { class: 'aca-search-results-row' } | |||
}) | |||
export class SearchResultsRowComponent implements OnInit, OnDestroy { | |||
private readonly highlightPrefix = "<span class='aca-highlight'>"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not we get this from the config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could but then the question comes which filter set we should base on, also there might be new ones added by the customers so this wouldn't be very reliable solution as well
...cts/aca-content/src/lib/components/search/search-results-row/search-results-row.component.ts
Show resolved
Hide resolved
8f2510e
to
4b22e05
Compare
Quality Gate passedIssues Measures |
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
What is the current behaviour? (You can also link to an open issue here)
Nothing is highlighted in search results.
What is the new behaviour?
Search phrase is highlighted in node name, title, description and content. Description is now part of name column. Highlighting config is added to each existing filters sets. https://alfresco.atlassian.net/browse/ACS-6427
Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information: