Elasticquent icon indicating copy to clipboard operation
Elasticquent copied to clipboard

Model::searchByQuery() method

Open marciomansur opened this issue 9 years ago • 3 comments

Hello,

When I use this function, the search returns only 10 records of a collection. After some hours of studying, I've read that is something to do with 'from' and 'size', it's something to do with pagination.

How can I get all records or rize the number of records (size) using elasticquent?

marciomansur avatar Mar 19 '15 01:03 marciomansur

public static function searchByQuery($query = null, $aggregations = null, $sourceFields = null, $limit = null, $offset = null, $sort = null)

so

searchByQuery($query, null, null, 666);

therpr avatar May 12 '15 11:05 therpr

@therpr I can't understand, in the method it has limit default null, but default limit is 10 records

skryvytskyi avatar Jun 28 '16 15:06 skryvytskyi

@skrivitsky https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-from-size.html

size defaults to 10

it's a feature in elasticsearch itself

therpr avatar Jun 29 '16 08:06 therpr