Skip to content

feat: Search Service Highlighting #1856

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

Merged
merged 33 commits into from
Jun 1, 2022
Merged

feat: Search Service Highlighting #1856

merged 33 commits into from
Jun 1, 2022

Conversation

allisonsuarez
Copy link
Contributor

@allisonsuarez allisonsuarez commented May 12, 2022

API highlighting options

Added Optional highlight options to search request, these allow specification of highlights for fields in each resource like:

{
    "results_per_page": 10,
    "page_index": 0,
    "resource_types": [
        "table"
    ],
    "query_term": "amundsen",
    "filters": [],
    "highlight_options": {
        "table": {
            "enable_highlight": true
        }
    }
}

Default highlighting

If "enable_highlight": true is for a resource the default highlight in ES will be:

    "name": {
        "number_of_fragments": 0
    },
    "description": {
        "number_of_fragments": 5,
        "order": "none"
    }

There are other highlights for specific resources like matching columns and column descriptions for tables, and chart and query name highlights for dashboards.

Databuilder dependency

If you are not using the latest mappings from databuilder which include "term_vector" : "with_positions_offsets".

Signed-off-by: Allison Suarez Miranda <[email protected]>
@allisonsuarez allisonsuarez requested a review from a team as a code owner May 12, 2022 04:15
@boring-cyborg boring-cyborg bot added area:search From the search folder category:api labels May 12, 2022
Signed-off-by: Allison Suarez Miranda <[email protected]>
Signed-off-by: Allison Suarez Miranda <[email protected]>
Signed-off-by: Allison Suarez Miranda <[email protected]>
Signed-off-by: Allison Suarez Miranda <[email protected]>
Signed-off-by: Allison Suarez Miranda <[email protected]>
Signed-off-by: Allison Suarez Miranda <[email protected]>
Signed-off-by: Allison Suarez Miranda <[email protected]>
Signed-off-by: Allison Suarez Miranda <[email protected]>
Signed-off-by: Allison Suarez Miranda <[email protected]>
wey-gu added a commit to wey-gu/amundsen that referenced this pull request May 15, 2022
note: still need amundsen-io#1856 to be included to work
as highlight_options introduced in frontend app
but not yet merged in search service
wey-gu added a commit to wey-gu/amundsen that referenced this pull request May 15, 2022
note: still need amundsen-io#1856 to be included to work
as highlight_options introduced in frontend app
but not yet merged in search service

Signed-off-by: wey-gu <[email protected]>
wey-gu added a commit to wey-gu/amundsen that referenced this pull request May 17, 2022
note: still need amundsen-io#1856 to be included to work
as highlight_options introduced in frontend app
but not yet merged in search service

Signed-off-by: wey-gu <[email protected]>
wey-gu added a commit to wey-gu/amundsen that referenced this pull request May 24, 2022
note: still need amundsen-io#1856 to be included to work
as highlight_options introduced in frontend app
but not yet merged in search service

Signed-off-by: wey-gu <[email protected]>
Signed-off-by: Allison Suarez Miranda <[email protected]>
Signed-off-by: Allison Suarez Miranda <[email protected]>
Signed-off-by: Allison Suarez Miranda <[email protected]>
@allisonsuarez allisonsuarez requested a review from dkunitsk May 24, 2022 21:41
Signed-off-by: Allison Suarez Miranda <[email protected]>
Signed-off-by: Allison Suarez Miranda <[email protected]>
Signed-off-by: Allison Suarez Miranda <[email protected]>
Signed-off-by: Allison Suarez Miranda <[email protected]>
Signed-off-by: Allison Suarez Miranda <[email protected]>
Signed-off-by: Allison Suarez Miranda <[email protected]>
Signed-off-by: Allison Suarez Miranda <[email protected]>
@allisonsuarez allisonsuarez requested a review from dkunitsk May 31, 2022 22:22
Signed-off-by: Allison Suarez Miranda <[email protected]>
Signed-off-by: Allison Suarez Miranda <[email protected]>
@boring-cyborg boring-cyborg bot added the area:common From common folder label May 31, 2022
@boring-cyborg boring-cyborg bot added the area:databuilder From databuilder folder label Jun 1, 2022
Signed-off-by: Allison Suarez Miranda <[email protected]>
Signed-off-by: Allison Suarez Miranda <[email protected]>
@allisonsuarez allisonsuarez merged commit 78dd856 into main Jun 1, 2022
@allisonsuarez allisonsuarez deleted the asm-hl-new branch June 1, 2022 21:19
allisonsuarez added a commit that referenced this pull request Jun 9, 2022
* feat: Search Service Highlighting

Signed-off-by: Allison Suarez Miranda <[email protected]>

* fixed unit test

Signed-off-by: Allison Suarez Miranda <[email protected]>

* put attrdict access in try in case of keyerror

Signed-off-by: Allison Suarez Miranda <[email protected]>

* stupid

Signed-off-by: Allison Suarez Miranda <[email protected]>

* ???

Signed-off-by: Allison Suarez Miranda <[email protected]>

* mock mathc

Signed-off-by: Allison Suarez Miranda <[email protected]>

* debug

Signed-off-by: Allison Suarez Miranda <[email protected]>

* all unit tests pass

Signed-off-by: Allison Suarez Miranda <[email protected]>

* lint

Signed-off-by: Allison Suarez Miranda <[email protected]>

* cinf fix

Signed-off-by: Allison Suarez Miranda <[email protected]>

* check that request has highlights

Signed-off-by: Allison Suarez Miranda <[email protected]>

* implemented feedback

Signed-off-by: Allison Suarez Miranda <[email protected]>

* empty checks

Signed-off-by: Allison Suarez Miranda <[email protected]>

* updated format response tests anhd put them in utils test file

Signed-off-by: Allison Suarez Miranda <[email protected]>

* fixed all tests

Signed-off-by: Allison Suarez Miranda <[email protected]>

* lint

Signed-off-by: Allison Suarez Miranda <[email protected]>

* mypy

Signed-off-by: Allison Suarez Miranda <[email protected]>

* isort

Signed-off-by: Allison Suarez Miranda <[email protected]>

* added another unit test

Signed-off-by: Allison Suarez Miranda <[email protected]>

* isort

Signed-off-by: Allison Suarez Miranda <[email protected]>

* major oopsie

Signed-off-by: Allison Suarez Miranda <[email protected]>

* some changes

Signed-off-by: Allison Suarez Miranda <[email protected]>

* updated test

Signed-off-by: Allison Suarez Miranda <[email protected]>

* latets pending marshmallow3-annotations bump

Signed-off-by: Allison Suarez Miranda <[email protected]>

* remove debugging line

Signed-off-by: Allison Suarez Miranda <[email protected]>

* isort

Signed-off-by: Allison Suarez Miranda <[email protected]>

* bumped marshmallow3-annotation to 1.1.0

Signed-off-by: Allison Suarez Miranda <[email protected]>

* typing extensions issue attempt to fix

Signed-off-by: Allison Suarez Miranda <[email protected]>

* had to convert sttrdict and lsit in the end

Signed-off-by: Allison Suarez Miranda <[email protected]>

* sort imports

Signed-off-by: Allison Suarez Miranda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:common From common folder area:databuilder From databuilder folder area:search From the search folder
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants