How to get total documents indexed? #164
Replies: 1 comment 2 replies
-
<?php
require_once __DIR__ . '/vendor/autoload.php';
$config = ['host'=>'127.0.0.1','port'=>9308];
$client = new \Manticoresearch\Client($config);
$index = $client->index('t');
$index->drop(true);
$index->create(['a' => ['type' => 'int']]);
$docs = []; for ($n=0;$n<100000;$n++) $docs[] = ['id' => 0, 'a' => rand(0,1000)];
$index->addDocuments($docs);
$result = $index->search('')->option('cutoff', 0)->limit(0)->get()->getTotal();
echo $result."\n";
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
d47081
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Can't find a method to output documents total stored in index
I just want to make statistic info in application without unlimited search query running.
e.g. documents total: 10000
Beta Was this translation helpful? Give feedback.
All reactions