You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/12/19 20:33:41 UTC

[GitHub] [nifi] exceptionfactory commented on a diff in pull request #6687: NIFI-10844 allow _source only output for GetElasticsearch and JsonQueryElasticsearch processors

exceptionfactory commented on code in PR #6687:
URL: https://github.com/apache/nifi/pull/6687#discussion_r1052613032


##########
nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/src/test/java/org/apache/nifi/elasticsearch/integration/ElasticSearchClientService_IT.java:
##########
@@ -205,19 +206,29 @@ void testVerifyFailedApiKeyAuth() {
 
     @Test
     void testBasicSearch() throws Exception {
+        assertBasicSearch(null);
+    }
+
+    @Test
+    void testBasicSearchRequestParameters() throws Exception {
+        assertBasicSearch(createParameters("preference", "_local"));
+    }
+
+    private void assertBasicSearch(final Map<String, String> requestParameters) throws JsonProcessingException {
         final Map<String, Object> temp = new MapBuilder()
-            .of("size", 10, "query", new MapBuilder().of("match_all", new HashMap<>()).build(),
-                    "aggs", new MapBuilder()
-                            .of("term_counts", new MapBuilder()
-                                    .of("terms", new MapBuilder()
-                                            .of("field", "msg", "size", 5)
-                                            .build())
-                                    .build())
-                            .build())
+                .of("size", 10, "query", new MapBuilder().of("match_all", new HashMap<>()).build(),

Review Comment:
   Recommend using `LinkedHashMap`:
   ```suggestion
                   .of("size", 10, "query", new MapBuilder().of("match_all", new LinkedHashMap<>()).build(),
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org