3

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.

  • You can try drupal.org/project/ultimate_cron it will give you an overview and you'll be able to see if any parts of the cron are causing trouble, then you'll be able to debug more easily. – prkos Apr 12 at 21:54
1

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.

  • 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. – RHa Apr 14 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.