You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "exceptionfactory (via GitHub)" <gi...@apache.org> on 2023/04/26 16:20:11 UTC

[GitHub] [nifi] exceptionfactory commented on a diff in pull request #7195: NIFI-11483 correctly use the DescribedValue enum for JsonQueryElasticsearch processor properties

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


##########
nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractJsonQueryElasticsearch.java:
##########
@@ -65,7 +65,7 @@
             .name("el-rest-split-up-hits")
             .displayName("Search Results Split")
             .description("Output a flowfile containing all hits or one flowfile for each individual hit.")
-            .allowableValues(ResultOutputStrategy.PER_RESPONSE.getValue(), ResultOutputStrategy.PER_HIT.getValue())
+            .allowableValues(ResultOutputStrategy.getNonPaginatedResponseOutputStrategies())

Review Comment:
   It should be possible to use `ResultOutputStrategy.class`:
   ```suggestion
               .allowableValues(ResultOutputStrategy.class)
   ```



##########
nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/src/main/java/org/apache/nifi/processors/elasticsearch/api/ResultOutputStrategy.java:
##########
@@ -52,6 +53,10 @@ public String getDescription() {
         return description;
     }
 
+    public static EnumSet<ResultOutputStrategy> getNonPaginatedResponseOutputStrategies() {
+        return EnumSet.of(PER_RESPONSE, PER_HIT);
+    }

Review Comment:
   Using the Class reference to `ResultOutputStrategy` should obviate the need for this method.



-- 
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