문제

I am having a hard time trying to use MatchAll in elastic search using elastica, currently I have the following querystring:

$pictureQuery = new \Elastica\Query\QueryString();
        $pictureQuery->setParam('query', $searchquery);
        $pictureQuery->setParam('fields', array(
            'caption'
        ));

        $items = $itemFinder->find($pictureQuery);

the issue with this query is that it only returns 10 results. I wanted to return all results, in this case MatchAll. I am however having issues on how to get all matching results, how do I do so?

도움이 되었습니까?

해결책

Elasticsearch returns by default the top 10 results (the more relevant). That's the expected behavior.

Elasticsearch allows to change page size (size) and change page (from). Have a look at From/Size API.

In Elastica, I guess it's here: http://elastica.io/api/classes/Elastica.Query.html#method_setSize

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top