Hi.

Some node types may not need to go through the insight module as not concered by SEO.

Excluding types in the configuration of contentanalysis would help (like xmlsitemap setup, for instance) controlling size of the mysql table and the reports, as in https://www.drupal.org/node/2306221#comment-8985585

Thanks.

CommentFileSizeAuthor
#1 allow-type-ignored.patch2.75 KBJulienThomas
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JulienThomas’s picture

FileSize
2.75 KB

To do this, I reviewed

function contentanalysis_do_analysis($context, $analyzers = NULL, $analyzers_params = array()) {

as follows:

a) relies on settings made in settings.conf, variable "contentanalysis_ignore_types". This variable is an array so settings is done with

$conf["contentanalysis_ignore_types"][]="type_1";
$conf["contentanalysis_ignore_types"][]="type_2";

Then before doing any analysis, we check the variable values

  // check if this node should be ignored
  $nid = $context['inputs']['nid'] ;
  if(empty($nid)) $nid = $context['inputs']['nid'] ;
  
  if(!empty($nid)) { 
    $arrIgnore = variable_get('contentanalysis_ignore_types', array()) ;
    if(!empty($arrIgnore)) {
      $node = node_load($nid);
      foreach($arrIgnore as $ctIgnore) {
        if($node -> type== $ctIgnore) {
             $analysis = $analysis_struc;
             $analysis['messages'] = contentanalysis_format_message("Sorry but this content type has been set as 'ignored' for contentanalysis");
             return $analysis;
        }
      }
    }
  }

This updates is associated to the following MySQL db updates:
insight_reports: 33k+ entries becomes 7k entries
insight_alerts: 110k+ entries becomes 30k entries

by removing only one content type that is extensively used but without SEO meaning.

To get this, I performed SQL queries as

delete from insight_alert where nid IN (select nid from node node where node.type="TYPE_TO_REMOVE_FROM_CA"); 

Example of patch is attached