Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Fixed
- Removed incorrect `model_id` from ML `SearchHitsHit`; ML search APIs return a standard search hit and the document ID is `_id` ([#1180](https://github.com/opensearch-project/opensearch-api-specification/issues/1180))
- Fixed `ml.predict_model` and `ml.predict_model_stream` request body schemas to match `RemoteInferenceMLInput` parser: corrected `parameters` type to `Map<String,String>`, removed incorrect `required` constraints, added `action_type`, `dlq`, `question`, and `context` fields, and added `PredictionActionType` enum ([#1188](https://github.com/opensearch-project/opensearch-api-specification/pull/1188))
- Fixed `ShardProfile`'s `fetch` to be an array of `FetchProfile`, added missing `inbound_network_time_in_millis` and `outbound_network_time_in_millis` fields, and corrected `FetchProfileBreakdown` to match server serialization ([#1147](https://github.com/opensearch-project/opensearch-api-specification/pull/1147))
- Fixed stale and malformed OpenSearch documentation links in spec `externalDocs` and schema descriptions ([#1163](https://github.com/opensearch-project/opensearch-api-specification/pull/1163))
- Fixed `DeletedPit` to mark `pit_id` and `successful` as required ([#1146](https://github.com/opensearch-project/opensearch-api-specification/pull/1146))
- Fixed `HitsMetadata` to mark `max_score` as required ([#1103](https://github.com/opensearch-project/opensearch-api-specification/pull/1103))
Expand Down
53 changes: 40 additions & 13 deletions spec/schemas/_core.search.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,21 @@ components:
$ref: '#/components/schemas/AggregationProfile'
id:
type: string
inbound_network_time_in_millis:
x-version-added: '2.0'
$ref: '_common.yaml#/components/schemas/DurationValueUnitMillis'
outbound_network_time_in_millis:
x-version-added: '2.0'
$ref: '_common.yaml#/components/schemas/DurationValueUnitMillis'
searches:
type: array
items:
$ref: '#/components/schemas/SearchProfile'
fetch:
$ref: '#/components/schemas/FetchProfile'
x-version-added: '3.2'
type: array
items:
$ref: '#/components/schemas/FetchProfile'
required:
- aggregations
- id
Expand Down Expand Up @@ -531,30 +540,48 @@ components:
FetchProfileBreakdown:
type: object
properties:
build_sub_phase_processors:
type: integer
format: int64
build_sub_phase_processors_count:
type: integer
format: int64
create_stored_fields_visitor:
type: integer
format: int64
create_stored_fields_visitor_count:
type: integer
format: int64
get_next_reader:
type: integer
format: int64
get_next_reader_count:
type: integer
format: int64
load_source:
type: integer
format: int32
format: int64
load_source_count:
type: integer
format: int32
format: int64
load_stored_fields:
type: integer
format: int32
format: int64
load_stored_fields_count:
type: integer
format: int32
next_reader:
type: integer
format: int32
next_reader_count:
format: int64
process:
type: integer
format: int32
format: int64
process_count:
type: integer
format: int32
process:
format: int64
set_next_reader:
type: integer
format: int32
format: int64
set_next_reader_count:
type: integer
format: int64
FetchProfileDebug:
type: object
properties:
Expand Down
33 changes: 33 additions & 0 deletions tests/default/_core/search/profile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test search endpoint with profile API enabled.
warnings:
invalid-path-detected: false
prologues:
- path: /movies/_doc
method: POST
parameters:
refresh: true
request:
payload:
director: Bennett Miller
title: Moneyball
year: 2011
status: [201]
epilogues:
- path: /movies
method: DELETE
status: [200, 404]
chapters:
- synopsis: Search with profile enabled returns fetch as an array.
path: /{index}/_search
parameters:
index: movies
method: POST
request:
payload:
profile: true
query:
match_all: {}
response:
status: 200