Skip to content

Commit

Permalink
Add getter for path field in NestedQueryBuilder (#4636)
Browse files Browse the repository at this point in the history
  • Loading branch information
psmagin authored Oct 4, 2022
1 parent 0c80a7a commit 7b7ca98
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 @@ -21,6 +21,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [Segment Replication] Add snapshot and restore tests for segment replication feature ([#3993](https://github.com/opensearch-project/OpenSearch/pull/3993))
- Added missing javadocs for `:example-plugins` modules ([#4540](https://github.com/opensearch-project/OpenSearch/pull/4540))
- Add missing Javadoc tag descriptions in unit tests ([#4629](https://github.com/opensearch-project/OpenSearch/pull/4629))
- Add getter for path field in NestedQueryBuilder ([#4636](https://github.com/opensearch-project/OpenSearch/pull/4636))
### Dependencies
- Bumps `log4j-core` from 2.18.0 to 2.19.0
- Bumps `reactor-netty-http` from 1.0.18 to 1.0.23
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 @@ -147,6 +147,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 7b7ca98

Please sign in to comment.