You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user/ppl/interfaces/endpoint.md
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -201,3 +201,55 @@ Expected output (trimmed):
201
201
- Plan node names use Calcite physical operator names (for example, `EnumerableCalc` or `CalciteEnumerableIndexScan`).
202
202
- Plan `time_ms` is inclusive of child operators and represents wall-clock time; overlapping work can make summed plan times exceed `summary.total_time_ms`.
203
203
- Scan nodes reflect operator wall-clock time; background prefetch can make scan time smaller than total request latency.
204
+
205
+
## Highlight
206
+
207
+
You can add a `highlight` parameter to the PPL request body to enable search-result highlighting. When enabled, the response includes a `_highlight` field containing matching fragments with the specified tags.
208
+
209
+
Two formats are supported:
210
+
211
+
### Simple array format
212
+
213
+
Pass a JSON array of field names or wildcards. Use `["*"]` to highlight all fields that match the search query.
214
+
215
+
```bash ppl
216
+
curl -sS -H 'Content-Type: application/json' \
217
+
-X POST localhost:9200/_plugins/_ppl \
218
+
-d '{
219
+
"query": "source=accounts \"Holmes\"",
220
+
"highlight": ["*"]
221
+
}'
222
+
```
223
+
224
+
### Object format (OpenSearch Dashboards)
225
+
226
+
Pass a JSON object with `fields`, `pre_tags`, `post_tags`, and `fragment_size`. This is the format used by OpenSearch Dashboards.
0 commit comments