Skip to content

Commit e0cfc17

Browse files
committed
Processors.ts - add fingerprint
Fixes #2593
1 parent a24055b commit e0cfc17

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

specification/ingest/_types/Processors.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ export class ProcessorContainer {
113113
* @doc_id fail-processor
114114
*/
115115
fail?: FailProcessor
116+
/**
117+
* Computes a hash of the document’s content. You can use this hash for
118+
* content fingerprinting.
119+
* @doc_id fingerprint-processor
120+
*/
121+
fingerprint?: FingerprintProcessor
116122
/**
117123
* Runs an ingest processor on each element of an array or object.
118124
* @doc_id foreach-processor
@@ -816,6 +822,33 @@ export class FailProcessor extends ProcessorBase {
816822
message: string
817823
}
818824

825+
export class FingerprintProcessor extends ProcessorBase {
826+
/**
827+
* Array of fields to include in the fingerprint. For objects, the processor
828+
* hashes both the field key and value. For other fields, the processor hashes
829+
* only the field value.
830+
*/
831+
fields: string[]
832+
/**
833+
* Output field for the fingerprint.
834+
*/
835+
target_field?: Field
836+
/**
837+
* Salt value for the hash function.
838+
*/
839+
salt?: string
840+
/**
841+
* The hash method used to compute the fingerprint. Must be one of MD5, SHA-1,
842+
* SHA-256, SHA-512, or MurmurHash3.
843+
*/
844+
method?: string
845+
/**
846+
* If true, the processor ignores any missing fields. If all fields are
847+
* missing, the processor silently exits without modifying the document.
848+
*/
849+
ignore_missing?: boolean
850+
}
851+
819852
export class ForeachProcessor extends ProcessorBase {
820853
/**
821854
* Field containing array or object values.

0 commit comments

Comments
 (0)