|
@@ 206-216 (lines=11) @@
|
| 203 |
|
} |
| 204 |
|
|
| 205 |
|
|
| 206 |
|
public function checkNumberOfIndexedDocuments($expectedAmount) { |
| 207 |
|
$index = $this->service->getIndex(); |
| 208 |
|
$status = $index->getStatus()->getData(); |
| 209 |
|
|
| 210 |
|
$numberDocsInIndex = -1; // flag value for not yet indexed |
| 211 |
|
if (isset($status['indices']['elastica_ss_module_test_en_us']['docs'])) { |
| 212 |
|
$numberDocsInIndex = $status['indices']['elastica_ss_module_test_en_us']['docs']['num_docs']; |
| 213 |
|
} |
| 214 |
|
|
| 215 |
|
$this->assertEquals($expectedAmount,$numberDocsInIndex); |
| 216 |
|
} |
| 217 |
|
|
| 218 |
|
/* |
| 219 |
|
Get the number of documents in an index. It is assumed the index exists, if not the test will fail |
|
@@ 221-232 (lines=12) @@
|
| 218 |
|
/* |
| 219 |
|
Get the number of documents in an index. It is assumed the index exists, if not the test will fail |
| 220 |
|
*/ |
| 221 |
|
public function getNumberOfIndexedDocuments() { |
| 222 |
|
$index = $this->service->getIndex(); |
| 223 |
|
$status = $index->getStatus()->getData(); |
| 224 |
|
|
| 225 |
|
$numberDocsInIndex = -1; // flag value for not yet indexed |
| 226 |
|
if (isset($status['indices']['elastica_ss_module_test_en_us']['docs'])) { |
| 227 |
|
$numberDocsInIndex = $status['indices']['elastica_ss_module_test_en_us']['docs']['num_docs']; |
| 228 |
|
} |
| 229 |
|
|
| 230 |
|
$this->assertGreaterThan(-1, $numberDocsInIndex); |
| 231 |
|
return $numberDocsInIndex; |
| 232 |
|
} |
| 233 |
|
} |
| 234 |
|
|