Skip to content

Commit

Permalink
Add getter for path field in NestedQueryBuilder (opensearch-project#4636
Browse files Browse the repository at this point in the history
)

(cherry picked from commit 7b7ca98)
Signed-off-by: psmagin <pavlo_smahin@epam.com>
  • Loading branch information
psmagin committed Dec 20, 2023
1 parent b2c77b0 commit aa0bdf0
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 @@ -34,6 +34,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- [BWC and API enforcement] Introduce checks for enforcing the API restrictions ([#11175](https://github.com/opensearch-project/OpenSearch/pull/11175))
- Maintainer approval check ([#11378](https://github.com/opensearch-project/OpenSearch/pull/11378))
- Create separate transport action for render search template action ([#11170](https://github.com/opensearch-project/OpenSearch/pull/11170))
- Add getter for path field in NestedQueryBuilder ([#4636](https://github.com/opensearch-project/OpenSearch/pull/4636))

### Dependencies
- Bumps jetty version to 9.4.52.v20230823 to fix GMS-2023-1857 ([#9822](https://github.com/opensearch-project/OpenSearch/pull/9822))
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 aa0bdf0

Please sign in to comment.