1
0
Эх сурвалжийг харах

Update ingest jdocs that a null return value will drop the current document. (#40359)

Martijn van Groningen 6 жил өмнө
parent
commit
963c9b8092

+ 3 - 0
server/src/main/java/org/elasticsearch/ingest/Pipeline.java

@@ -89,6 +89,9 @@ public final class Pipeline {
 
     /**
      * Modifies the data of a document to be indexed based on the processor this pipeline holds
+     *
+     * If <code>null</code> is returned then this document will be dropped and not indexed, otherwise
+     * this document will be kept and indexed.
      */
     public IngestDocument execute(IngestDocument ingestDocument) throws Exception {
         long startTimeInNanos = relativeTimeProvider.getAsLong();

+ 3 - 0
server/src/main/java/org/elasticsearch/ingest/Processor.java

@@ -39,6 +39,9 @@ public interface Processor {
 
     /**
      * Introspect and potentially modify the incoming data.
+     *
+     * @return If <code>null</code> is returned then the current document will be dropped and not be indexed,
+     *         otherwise this document will be kept and indexed
      */
     IngestDocument execute(IngestDocument ingestDocument) throws Exception;