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

Use path to indicate highlighted index of array items #107853

Open
jsphstls opened this issue Apr 24, 2024 · 1 comment
Open

Use path to indicate highlighted index of array items #107853

jsphstls opened this issue Apr 24, 2024 · 1 comment
Labels
>enhancement :Search/Highlighting How a query matched a document Team:Search Meta label for search team

Comments

@jsphstls
Copy link

Description

Highlighted items within objects clearly indicate the matching item by using a path:

"highlight": {
  "address.street": [
     "123 <em>Some</em> Street"
  ]
}

Yet, highlighted items within arrays do not indicate the matching item with respect to other items:

"_source": {
  "someArray": [
    "some item",
    "another item"
  ]
},
"highlight": {
  "someArray": [
     "<em>some</em> item"
  ]
}

This makes it difficult to determine which item of an array was actually highlighted without parsing the content.

One possible improvement would be to use a path to indicate highlighted index of array items:

"highlight": {
  "someArray[0]": [
     "<em>some</em> item"
  ]
}
@jsphstls jsphstls added >enhancement needs:triage Requires assignment of a team area label labels Apr 24, 2024
@saikatsarkar056 saikatsarkar056 added the Team:Search Meta label for search team label Apr 25, 2024
@elasticsearchmachine elasticsearchmachine removed the Team:Search Meta label for search team label Apr 25, 2024
@saikatsarkar056 saikatsarkar056 added the :Search/Highlighting How a query matched a document label Apr 25, 2024
@elasticsearchmachine elasticsearchmachine added Team:Search Meta label for search team and removed needs:triage Requires assignment of a team area label labels Apr 25, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Highlighting How a query matched a document Team:Search Meta label for search team
Projects
None yet
Development

No branches or pull requests

3 participants