strapi-plugin-meilisearch-plus 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1374,9 +1374,9 @@ const contentTypes = ({ strapi }) => ({
1374
1374
  const index2 = client.index(finalIndexName);
1375
1375
  const result = await index2.search("", {
1376
1376
  filter: [`_contentType = "${contentType}"`],
1377
- limit: 0
1377
+ limit: 1
1378
1378
  });
1379
- return result.estimatedTotalHits || 0;
1379
+ return result.total || result.estimatedTotalHits || 0;
1380
1380
  } catch (error) {
1381
1381
  if (error?.message?.includes("not found")) {
1382
1382
  strapi.log.debug(
@@ -1373,9 +1373,9 @@ const contentTypes = ({ strapi }) => ({
1373
1373
  const index2 = client.index(finalIndexName);
1374
1374
  const result = await index2.search("", {
1375
1375
  filter: [`_contentType = "${contentType}"`],
1376
- limit: 0
1376
+ limit: 1
1377
1377
  });
1378
- return result.estimatedTotalHits || 0;
1378
+ return result.total || result.estimatedTotalHits || 0;
1379
1379
  } catch (error) {
1380
1380
  if (error?.message?.includes("not found")) {
1381
1381
  strapi.log.debug(
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.3",
2
+ "version": "0.1.4",
3
3
  "keywords": [],
4
4
  "type": "commonjs",
5
5
  "exports": {