<!-- Source: https://docs.squirro.com/en/latest/api/squirro.lib.nlp.steps.filters.MergeFilter.html -->
# MergeFilter

**`class MergeFilter(config)`**

Bases: [`Filter`](squirro.lib.nlp.steps.filters.Filter.md#squirro.lib.nlp.steps.filters.Filter)

The merge [`Filter`](squirro.lib.nlp.steps.filters.Filter.md#squirro.lib.nlp.steps.filters.Filter) merges multiple fields into a single field

**Input** - all input fields needs to be of type [`str`](https://docs.python.org/3.11/library/stdtypes.html#str), [`list`](https://docs.python.org/3.11/library/stdtypes.html#list) [ [`str`](https://docs.python.org/3.11/library/stdtypes.html#str) ] or [`list`](https://docs.python.org/3.11/library/stdtypes.html#list) [ {‘body’: [`str`](https://docs.python.org/3.11/library/stdtypes.html#str)} ].

**Output** - the output field is filled with data of type [`str`](https://docs.python.org/3.11/library/stdtypes.html#str).

Parameters

- `type` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)) – merge
- `input_fields` ([`list`](https://docs.python.org/3.11/library/stdtypes.html#list)) – Fields to merge
- `output_field` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)) – Field to merge into
- `delimiter` ([`str`](https://docs.python.org/3.11/library/stdtypes.html#str)`, ``' '`) – String to merge on

**Example**

```json
{
    "step": "filter",
    "type": "merge",
    "input_fields":["title","body"],
    "output_field":"text"
}
```

Methods SummaryMethods Documentation

**`process_doc(doc)`**

Process a document

Parameters

`doc` ([`Document`](../technical/libnlp/base.md#squirro.lib.nlp.document.Document)) – Document

Returns

Processed document

Return type

[Document](../technical/libnlp/base.md#squirro.lib.nlp.document.Document)
