By RHa


2019-04-12 18:00:39 8 Comments

On a Drupal 8 website I'm administering the ratio of paged indexed by search_cron stays at a value far below 100%.

New pages are indexed, but it looks as if updated pages are not indexed again. I suspect that there is some problem that keeps nodes from being (re-)indexed. However, I see no error in the log. Search_cron takes very long - several minutes even when indexing only 20 pages per cron run.

There is a page Troubleshooting cron which contains an SQL query (under "Check for problems with modules") to find nodes that haven't been indexed so one can inspect them for bad content. Unfortunately, this works only with Drupal 7, and I couldn't find a similar page for Drupal 8.

How can I find non-indexed nodes on Drupal 8?

Any other idea on how to track down the problem?

Update: I now found a way to log the nodes being indexed by adding a call to the logger to NodeSearch.php. Which admittedly is a hack.

I can now see that Drupal tries to index the same nodes again and again, without success and without error messages. However, I haven't found out the reason yet.

1 comments

@Shawn Conn 2019-04-13 22:01:45

The status of node indexing is based on the search_dataset. This table stores content keyword blobs and their associated sid, the primary key for the content's keyword (i.e. the nid). When compared/joined against the node table, it should let you see which nodes aren't index.

From what it sounds like, you've already spotted problem node(s) so it's just a matter of confirmation. Removing the node(s) from being indexed (e.g. hacking NodeSearch::indexNode()) to confirm it's the problem, then finding out what content in the node is blocking indexer.

@RHa 2019-04-14 13:39:13

I now found the cause of the problem: There are entries in search_dataset with langcode='und' which are not updated by the indexer, so the indexer is called again and again for these nodes. Deleting these entries fixes the problem.

Related Questions

Sponsored Content

0 Answered Questions

Weekly Drupal cron task exiting unexpectedly, Drupal not reporting error

  • 2019-04-22 18:47:53
  • saramm1
  • 17 View
  • 0 Score
  • 0 Answer
  • Tags:   cron

1 Answered Questions

Search indexing slow query

1 Answered Questions

[SOLVED] How do I set up Search API index as cron task?

2 Answered Questions

[SOLVED] Fixing bad node that makes search not index, but completes cron

  • 2016-03-18 20:11:35
  • Huginn
  • 272 View
  • 1 Score
  • 2 Answer
  • Tags:   search debugging

1 Answered Questions

1 Answered Questions

Cron Authentication Error

  • 2014-02-19 17:34:41
  • Dan R
  • 122 View
  • 1 Score
  • 1 Answer
  • Tags:   cron

0 Answered Questions

"Cannot use string offset as an array" when attempting to run SOLR index

  • 2013-12-13 14:23:51
  • oranges13
  • 129 View
  • 0 Score
  • 0 Answer
  • Tags:   7 search

1 Answered Questions

[SOLVED] Intermittent "Cron already running error"

  • 2013-09-17 23:33:46
  • longboardnode
  • 2185 View
  • 1 Score
  • 1 Answer
  • Tags:   cron

1 Answered Questions

[SOLVED] What does it mean if an item in Search API has a "-1" flag and is never indexed?

  • 2012-06-23 13:00:24
  • user568458
  • 603 View
  • 2 Score
  • 1 Answer
  • Tags:   cron search queue

0 Answered Questions

Search index keeps resetting itself to certain percentage done

  • 2012-06-08 10:44:01
  • Paul
  • 137 View
  • 0 Score
  • 0 Answer
  • Tags:   6 search

Sponsored Content