manticoresoftware / manticoresearch-php

Official PHP client for Manticore Search
MIT License
160 stars 32 forks source link

`getDocumentByIds` returns not all documents when size of array > 20 #174

Closed donhardman closed 7 months ago

donhardman commented 7 months ago

This code only retrieves 20 documents, and currently, we don't have the option to chain a limit setting in the Client. However, I believe we shouldn't need to. We have an array of IDs, which should allow us to determine the necessary limit to fetch all the documents.

$index->getDocumentByIds($ids); # Only 20 returns even when ids contains more

Currently, it's not functioning. The solution is simply to set the limit to the size of the $ids array.

donhardman commented 7 months ago

The fix can be found here: https://github.com/manticoresoftware/manticoresearch-php/pull/175

But I think it's a good idea to check whether this is the only place that needs modification and to ensure we don't have a similar issue elsewhere.

sanikolaev commented 7 months ago

Let's add a test for "returns not all documents when size of array > 20".

Nick-S-2018 commented 7 months ago

Done in https://github.com/manticoresoftware/manticoresearch-php/commit/84281631b6f311925005201e3de20132f2f85669