Document/Repository/ArticleViewDocumentRepository.php
public function findSimilar(
        $uuid,
        $limit = self::DEFAULT_LIMIT,
        array $types = null,
        $locale = null,
        $webspaceKey = null
    ) {
        $search = $this->createSearch($limit, $types, $locale, $webspaceKey);

        $search->addQuery(
            new MoreLikeThisQuery(
                null,
                [
                    'fields' => $this->searchFields,
                    'min_term_freq' => 1,
                    'min_doc_freq' => 2,
                    'like' => [
                        [
                            '_id' => $this->getViewDocumentId($uuid, $locale),
                        ],
                    ],
                ]
            )
        );

        return $this->repository->findDocuments($search);
    }
public function findSimilar(
        $uuid,
        $limit = self::DEFAULT_LIMIT,
        array $types = null,
        $locale = null,
        $webspaceKey = null
    ) {
        $search = $this->createSearch($limit, $types, $locale, $webspaceKey);

        $search->addQuery(
            new MoreLikeThisQuery(
                null,
                [
                    'fields' => $this->searchFields,
                    'min_term_freq' => 1,
                    'min_doc_freq' => 2,
                    'like' => [
                        [
                            '_id' => $this->getViewDocumentId($uuid, $locale),
                        ],
                    ],
                ]
            )
        );

        return $this->repository->findDocuments($search);
    }
public function findSimilar ( $ uuid , $ limit = self :: DEFAULT_LIMIT , array $ types = null , $ locale = null , $ webspaceKey = null ) { $ search = $ this -> createSearch ( $ limit , $ types , $ locale , $ webspaceKey ) ; $ search -> addQuery ( new MoreLikeThisQuery ( null , [ 'fields' => $ this -> searchFields , 'min_term_freq' => 1 , 'min_doc_freq' => 2 , 'like' => [ [ '_id' => $ this -> getViewDocumentId ( $ uuid , $ locale ) , ] , ] , ] ) ) ; return $ this -> repository -> findDocuments ( $ search ) ; }
Finds similar articles for given `uuid` with given parameters.

@param string $uuid
@param int $limit
@param null|array $types
@param null|string $locale
@param null|string $webspaceKey

@return DocumentIterator
Finds similar articles for given uuid with given parameters .