diff -u b/core/modules/node/src/Plugin/Search/NodeSearch.php b/core/modules/node/src/Plugin/Search/NodeSearch.php --- b/core/modules/node/src/Plugin/Search/NodeSearch.php +++ b/core/modules/node/src/Plugin/Search/NodeSearch.php @@ -358,7 +358,7 @@ } // Update index, using search index "type" equal to the plugin ID. - search_index($node->id(), $this->getPluginId(), $text, $language->getId()); + search_index($this->getPluginId(), $node->id(), $language->getId(), $text); } } diff -u b/core/modules/search/search.module b/core/modules/search/search.module --- b/core/modules/search/search.module +++ b/core/modules/search/search.module @@ -368,19 +368,19 @@ /** * Updates the full-text search index for a particular item. * - * @param $sid - * An ID number identifying this particular item (e.g., node ID). * @param $type * The plugin ID or other machine-readable type of this item, * which should be less than 64 bytes. - * @param $text - * The content of this item. Must be a piece of HTML or plain text. + * @param $sid + * An ID number identifying this particular item (e.g., node ID). * @param $langcode * Language code for text being indexed. + * @param $text + * The content of this item. Must be a piece of HTML or plain text. * * @ingroup search */ -function search_index($sid, $type, $text, $langcode) { +function search_index($type, $sid, $langcode, $text) { $minimum_word_size = \Drupal::config('search.settings')->get('index.minimum_word_size'); // Multipliers for scores of words inside certain HTML tags. The weights are @@ -516,7 +516,7 @@ * @param int $sid * (optional) An ID number identifying this particular item (e.g., node ID). * If omitted, everything matching $type is marked, and $langcode is ignored. - * @param strong $langcode + * @param string $langcode * (optional) The language code to clear. If omitted, everything matching * $type and $sid is marked. */ diff -u b/core/modules/search/src/Tests/SearchMultilingualEntityTest.php b/core/modules/search/src/Tests/SearchMultilingualEntityTest.php --- b/core/modules/search/src/Tests/SearchMultilingualEntityTest.php +++ b/core/modules/search/src/Tests/SearchMultilingualEntityTest.php @@ -232,7 +232,7 @@ // Add a bogus entry to the search index table using a different search // type. This will not appear in the index status, because it is not // managed by a plugin. - search_index($this->searchable_nodes[0]->id(), 'foo', 'some text', 'en'); + search_index('foo', $this->searchable_nodes[0]->id(), 'en', 'some text'); $this->assertIndexCounts(1, 8, 'after adding a different index item'); // Mark just this "foo" index for reindexing. only in patch2: unchanged: --- a/core/modules/search/src/Tests/SearchMatchTest.php +++ b/core/modules/search/src/Tests/SearchMatchTest.php @@ -36,10 +36,10 @@ function _setup() { \Drupal::config('search.settings')->set('index.minimum_word_size', 3)->save(); for ($i = 1; $i <= 7; ++$i) { - search_index($i, SEARCH_TYPE, $this->getText($i), LanguageInterface::LANGCODE_NOT_SPECIFIED); + search_index(SEARCH_TYPE, $i, LanguageInterface::LANGCODE_NOT_SPECIFIED, $this->getText($i)); } for ($i = 1; $i <= 5; ++$i) { - search_index($i + 7, SEARCH_TYPE_2, $this->getText2($i), LanguageInterface::LANGCODE_NOT_SPECIFIED); + search_index(SEARCH_TYPE_2, $i + 7, LanguageInterface::LANGCODE_NOT_SPECIFIED, $this->getText2($i)); } // No getText builder function for Japanese text; just a simple array. foreach (array( @@ -47,7 +47,7 @@ function _setup() { 14 => 'ドルーパルが大好きよ!', 15 => 'コーヒーとケーキ', ) as $i => $jpn) { - search_index($i, SEARCH_TYPE_JPN, $jpn, LanguageInterface::LANGCODE_NOT_SPECIFIED); + search_index(SEARCH_TYPE_JPN, $i, LanguageInterface::LANGCODE_NOT_SPECIFIED, $jpn); } search_update_totals(); }