CoalesceFilter#

class CoalesceFilter(config)#

Bases: Filter

The coalesce Filter returns the first value which is set from a list of fields. Any string or list is accepted as the valid value, None is treated as not having been set.

Input - any type can be used for the input fields.

Output - the output field is filled with data of type str.

Parameters
  • type (str) – coalesce

  • input_fields (list) – Fields to look at

  • output_field (str) – Field to store the resulting value

Example

{
    "step": "filter",
    "type": "coalesce",
    "input_fields": ["clean_body", "body"],
    "output_field": "processing_body"
}

Methods Summary

process_doc(doc)

Process a document

Methods Documentation

process_doc(doc)#

Process a document

Parameters

doc (Document) – Document

Returns

Processed document

Return type

Document