Commit aed8457e authored by Emiliano Balbuena's avatar Emiliano Balbuena
Browse files

(feat): Filter deleted entities on global feeds

parent 991bd361
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -190,6 +190,18 @@ class Repository
            ];
        }

        if (!$opts['container_guid'] && !$opts['owner_guid']) {
            if (!isset($body['query']['function_score']['query']['bool']['must_not'])) {
                $body['query']['function_score']['query']['bool']['must_not'] = [];
            }

            $body['query']['function_score']['query']['bool']['must_not'][] = [
                'term' => [
                    'deleted' => true,
                ],
            ];
        }

        if ($opts['custom_type']) {
            $customTypes = Text::buildArray($opts['custom_type']);