From 873848545618d317c76bf8ccb91895fe46f64d68 Mon Sep 17 00:00:00 2001 From: Petar Dzepina Date: Fri, 27 Jan 2023 01:09:35 +0100 Subject: [PATCH] spotless check fix; changelog Signed-off-by: Petar Dzepina --- CHANGELOG.md | 1 + .../index/query/QueryStringQueryBuilderTests.java | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20c89ad484ad5..7f09123438b4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,6 +75,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased 2.x] ### Added +- Added new public method to QueryStringQueryBuilder to extract all used fields ([#6020](https://github.com/opensearch-project/OpenSearch/pull/6020)) - Adding index create block when all nodes have breached high disk watermark ([#5852](https://github.com/opensearch-project/OpenSearch/pull/5852)) - Added cluster manager throttling stats in nodes/stats API ([#5790](https://github.com/opensearch-project/OpenSearch/pull/5790)) - Added support for feature flags in opensearch.yml ([#4959](https://github.com/opensearch-project/OpenSearch/pull/4959)) diff --git a/server/src/test/java/org/opensearch/index/query/QueryStringQueryBuilderTests.java b/server/src/test/java/org/opensearch/index/query/QueryStringQueryBuilderTests.java index 27ad3ad8ca3fb..51444ccf3f07b 100644 --- a/server/src/test/java/org/opensearch/index/query/QueryStringQueryBuilderTests.java +++ b/server/src/test/java/org/opensearch/index/query/QueryStringQueryBuilderTests.java @@ -466,17 +466,16 @@ public void testExtractAllUsedFields() { assertTrue(allUsedFields.contains(KEYWORD_FIELD_NAME)); // fields with field prefix - allUsedFields = queryStringQuery("654654356") - .fields(Map.of(TEXT_FIELD_NAME, 1.0f, OBJECT_FIELD_NAME + ".*", 1.0f)) + allUsedFields = queryStringQuery("654654356").fields(Map.of(TEXT_FIELD_NAME, 1.0f, OBJECT_FIELD_NAME + ".*", 1.0f)) .extractAllUsedFields(createShardContext()); assertTrue(allUsedFields.contains(TEXT_FIELD_NAME)); assertTrue(allUsedFields.contains(OBJECT_FIELD_NAME + "." + DATE_FIELD_NAME)); assertTrue(allUsedFields.contains(OBJECT_FIELD_NAME + "." + INT_FIELD_NAME)); // field prefix in query_string with bear token and fields combo - allUsedFields = queryStringQuery(TEXT_FIELD_NAME + "\\*:test 12345") - .fields(Map.of(INT_FIELD_NAME, 1.0f, OBJECT_FIELD_NAME + ".*", 1.0f)) - .extractAllUsedFields(createShardContext()); + allUsedFields = queryStringQuery(TEXT_FIELD_NAME + "\\*:test 12345").fields( + Map.of(INT_FIELD_NAME, 1.0f, OBJECT_FIELD_NAME + ".*", 1.0f) + ).extractAllUsedFields(createShardContext()); assertTrue(allUsedFields.contains(TEXT_FIELD_NAME)); assertTrue(allUsedFields.contains(KEYWORD_FIELD_NAME)); assertTrue(allUsedFields.contains(OBJECT_FIELD_NAME + "." + DATE_FIELD_NAME));