Pergunta

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?

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top