protected function ElasticsearchTest::indexItems in Elasticsearch Connector 8.6
Same name and namespace in other branches
- 8.7 tests/src/Kernel/ElasticsearchTest.php \Drupal\elasticsearch_connector\Tests\Kernel\ElasticsearchTest::indexItems()
- 8.5 tests/src/Kernel/ElasticsearchTest.php \Drupal\elasticsearch_connector\Tests\Kernel\ElasticsearchTest::indexItems()
Indexes all (unindexed) items on the specified index.
Parameters
string $index_id: The ID of the index on which items should be indexed.
Return value
int The number of successfully indexed items.
Overrides ExampleContentTrait::indexItems
1 call to ElasticsearchTest::indexItems()
- ElasticsearchTest::regressionTests2 in tests/
src/ Kernel/ ElasticsearchTest.php - Regression Tests 2.
File
- tests/
src/ Kernel/ ElasticsearchTest.php, line 90
Class
- ElasticsearchTest
- Tests index and search capabilities using the elasticsearch backend.
Namespace
Drupal\elasticsearch_connector\Tests\KernelCode
protected function indexItems($index_id) {
/** @var \Drupal\search_api\Index\IndexInterface $index */
$index = Index::load($index_id);
$index
->setOption('index_directly', TRUE);
return $index
->index();
}