When marking content for reindexing using drush solr-mark-all, the documentation for this command suggests that content types can be supplied to narrow down the scope of what is marked for reindexing. However, looking through the code this process gets handed off to the 'apachesolr_index_mark_for_reindex', which only checks for entity types. If you wanted to only mark for reindexing, say, on articles, "drush solr-mark-all article" wouldn't work as the entity type is node.

This patch should allow a content type or an entity type to be passed in, and both node types and entity types will be reindexed depending on the parameters specified.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bjpritch’s picture

Status: Active » Needs review
FileSize
1.18 KB
gnindl’s picture

@bjpritch,

I stumbled upon the same problem. I am not sure if your patch can still index all content types if you do not supply an argument.

Attached is a patch for 6.x-3.x-dev, is very similar, but handles conditionals slightly differently, for your inspiration....

Status: Needs review » Needs work

The last submitted patch, 2: solr-index-per-content-type.patch, failed testing.

bjpritch’s picture

@gnindl

"I am not sure if your patch can still index all content types if you do not supply an argument."

Was this confirmed? I checked this before submitting the patch, that both "drush solr-mark-all" and "drush solr-mark-all $content_type" work as expected. If you found different results I would be interested in what inconsistency you're seeing with "drush solr-mark-all"

bjpritch’s picture

Status: Needs work » Needs review
jgrubb’s picture

Status: Needs review » Reviewed & tested by the community

Works just fine for me.

  • bjpritch authored 258d79c on 7.x-1.x
    Fixes #2463995 by bjpritch: drush mark-all option doesn't work with node...
jgrubb’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.