Skip to content

Commit

Permalink
Add getter for path field in NestedQueryBuilder (#4636) (#11657)
Browse files Browse the repository at this point in the history
(cherry picked from commit 7b7ca98)
Signed-off-by: psmagin <[email protected]>

Signed-off-by: Daniel (dB.) Doubrovkine <[email protected]>
Signed-off-by: Pavlo Smahin <[email protected]>
Co-authored-by: Daniel (dB.) Doubrovkine <[email protected]>
  • Loading branch information
psmagin and dblock authored Jan 24, 2024
1 parent 6b79ec5 commit f588880
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Add match_only_text field that is optimized for storage by trading off positional queries performance ([#6836](https://github.com/opensearch-project/OpenSearch/pull/11039))
- Add copy ingest processor ([#11870](https://github.com/opensearch-project/OpenSearch/pull/11870))
- Introduce new feature flag "WRITEABLE_REMOTE_INDEX" to gate the writeable remote index functionality ([#11717](https://github.com/opensearch-project/OpenSearch/pull/11170))
- Add getter for path field in NestedQueryBuilder ([#4636](https://github.com/opensearch-project/OpenSearch/pull/4636))
- Bump OpenTelemetry from 1.32.0 to 1.34.1 ([#11891](https://github.com/opensearch-project/OpenSearch/pull/11891))
- Add `org.opensearch.rest.MethodHandlers` and `RestController#getAllHandlers` ([11876](https://github.com/opensearch-project/OpenSearch/pull/11876))
- Support index level allocation filtering for searchable snapshot index ([#11563](https://github.com/opensearch-project/OpenSearch/pull/11563))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ protected void doWriteTo(StreamOutput out) throws IOException {
out.writeBoolean(ignoreUnmapped);
}

/**
* Returns path of the nested query.
*/
public String path() {
return path;
}

/**
* Returns the nested query to execute.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ public void testSerializationBWC() throws IOException {
}
}

public void testPath() {
assertEquals("nested1", createTestQueryBuilder().path());
}

public void testValidate() {
QueryBuilder innerQuery = RandomQueryBuilder.createQuery(random());
IllegalArgumentException e = expectThrows(
Expand Down

0 comments on commit f588880

Please sign in to comment.