Hi guys, In the documentation <https://typesense....
# community-help
l
Hi guys, In the documentation https://typesense.org/docs/0.22.2/api/documents.html#search-parameters we can see:
Copy code
per_page
Number of results to fetch per page.

When group_by is used, per_page refers to the number of groups to fetch per page, in order to properly preserve pagination.

Default: 10

NOTE: Only up to 250 hits (or groups of hits when using group_by) can be fetched per page.
However, if I launch a request like:
Copy code
final searchParameters = {
          'q': '',
          'query_by': 'genericTicker',
          'filter_by': 'dateLastUpdate:>=${lastUpdateTimestamp.toString()}',
          'limit_hits': '1000000',
        };
it only returns 10 results. In order to force more results I have to add
'per_page': '250'
but it is limited to 250, I cannot receive all the documents in the collection. The documentation gives this 250 limit for
group_by
but not for
filter_by
How can I get all the results from the collection without limit when I use
filter_by
?
j
@Loïc If you don't have a text-based query, and you're only using filters, you can use the documents export endpoint which supports filter_by and doesn't have any limits: https://typesense.org/docs/0.22.2/api/documents.html#export-documents
l
How do you please apply the filter_by in dart in ?
Copy code
await client.collection('companies').documents.exportJSONL();
j
I'm not sure about the exact syntax (I'm not familiar with Dart), but that method accepts a map with query parameters: https://github.com/typesense/typesense-dart/blob/433e862bbbc8655975be7f17831eb25c02386e04/lib/src/documents.dart#L107
l
Copy code
401: {"message": "Forbidden - a valid `x-typesense-api-key` header must be sent."}
j
You want to make sure the API key you're using has the
documents:export
permission
l
It is working with a new api key as recommended. However it returns a single String. How do you guys usually parse this thing? 🤔
j
It's in JSONL format, which is just one json object per line
So you would have to split the string by newline and do a JSON parse on each line
l
Got you, thank you @Jason Bosco! Really appreciate your help and reactivity everytime!
j
Happy to help! 🙂