Skip to content

Commit 87bb284

Browse files
committed
peng - update the doc to reflect the changes
Signed-off-by: Jialiang Liang <jiallian@amazon.com>
1 parent 9b99296 commit 87bb284

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

docs/user/ppl/interfaces/endpoint.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ Expected output (trimmed):
204204

205205
## Highlight
206206

207-
You can add a `highlight` parameter to the PPL request body to enable search-result highlighting. When enabled, the response includes a top-level `highlights` array containing matching fragments with the specified tags. Each entry in the `highlights` array corresponds to the row at the same index in `datarows`.
207+
You can add a `highlight` parameter to the PPL request body to enable search-result highlighting. This parameter follows the same semantics as the [OpenSearch highlight API](https://docs.opensearch.org/latest/search-plugins/searching-data/highlight/). When enabled, the response includes a top-level `highlights` array containing matching fragments with the specified tags. Each entry in the `highlights` array corresponds to the row at the same index in `datarows`.
208208

209209
Two formats are supported:
210210

@@ -278,11 +278,11 @@ Expected output (trimmed):
278278
| `fields` | Object | Yes | An object whose keys are field names or wildcards (e.g. `{"*": {}}`) to highlight. |
279279
| `pre_tags` | Array of string | No | Tags inserted before highlighted tokens. Defaults to `<em>`. |
280280
| `post_tags` | Array of string | No | Tags inserted after highlighted tokens. Defaults to `</em>`. |
281-
| `fragment_size` | Integer | No | Maximum character size of a highlight fragment. Defaults to `2147483647` (returns the full field value). |
281+
| `fragment_size` | Integer | No | Maximum character size of a highlight fragment. Defaults to `100`. |
282282

283283
### Notes
284284

285285
- Highlighting requires a search query in the PPL statement (e.g. `source=accounts "Holmes"`). Without a query, the `highlights` array entries will be empty.
286286
- The `highlights` array in the response is parallel to `datarows` — each entry contains the highlighted fragments for the corresponding row.
287-
- In the simple array format, `["*"]` highlights all fields. Specific terms like `["error", "login"]` highlight those terms across all fields.
287+
- In the simple array format, `["*"]` highlights all fields. Specific field names like `["firstname", "lastname"]` scope highlighting to those fields only.
288288
- In the object format, only the keys of the `fields` object are used; per-field options inside the value objects are currently ignored.

0 commit comments

Comments
 (0)