src/Services/DocumentSearch.php
private function set_filter()
    {
        if (isset($this->arrSearch['filter'])) {
            if (!is_array($this->arrSearch['filter'])) {
                throw new DocumentSearchWrongFilter('"Filter" key is not an array');
            }

            $arrFilterLines = [];
            foreach ($this->arrSearch['filter'] as $field => $value) {
                $arrFilterLines[] = sprintf(
                    'filter(%s:%s)',
                    $field,
                    json_encode(array_map('stripslashes', $value), JSON_UNESCAPED_UNICODE)
                );
            }

            $strFilterOperator = 'OR';
            if (isset($this->arrSearch['filter_operator'])) {
                $strFilterOperator = $this->arrSearch['filter_operator'];
            }

            $this->arrPayload['filter'] = implode(' ' . $strFilterOperator . ' ', $arrFilterLines);
        }

        return $this;
    }
private function set_filter()
    {
        if (isset($this->arrSearch['filter'])) {
            if (!is_array($this->arrSearch['filter'])) {
                throw new DocumentSearchWrongFilter('"Filter" key is not an array');
            }

            $arrFilterLines = [];
            foreach ($this->arrSearch['filter'] as $field => $value) {
                $arrFilterLines[] = sprintf(
                    'filter(%s:%s)',
                    $field,
                    json_encode(array_map('stripslashes', $value), JSON_UNESCAPED_UNICODE)
                );
            }

            $strFilterOperator = 'OR';
            if (isset($this->arrSearch['filter_operator'])) {
                $strFilterOperator = $this->arrSearch['filter_operator'];
            }

            $this->arrPayload['filter'] = implode(' ' . $strFilterOperator . ' ', $arrFilterLines);
        }

        return $this;
    }
Set filter

@return DocumentSearch
@throws DocumentSearchWrongFilter