/**
* Tests the indexing throttle and search results with multilingual nodes.
*/
public function testMultilingualSearch() { // Index only 2 nodes per cron run. We cannot do this setting in the UI,
// because it doesn't go this low.
$this->
config('search.settings'
)->
set('index.cron_limit', 2
)->
save();
// Get a new search plugin, to make sure it has this setting.
$this->plugin =
$this->container->
get('plugin.manager.search'
)->
createInstance('node_search'
);
// Update the index. This does the initial processing.
$this->plugin->
updateIndex();
// Run the shutdown function. Testing is a unique case where indexing
// and searching has to happen in the same request, so running the shutdown
// function manually is needed to finish the indexing process.
$search_index = \Drupal::
service('search.index'
);
assert($search_index instanceof SearchIndexInterface
);
$this->
assertIndexCounts(6, 8, 'after updating partially'
);
$this->
assertDatabaseCounts(2, 0, 'after updating partially'
);
// Now index the rest of the nodes.
// Make sure index throttle is high enough, via the UI.
$this->
drupalGet('admin/config/search/pages'
);