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.
Comment | File | Size | Author |
---|---|---|---|
#2 | solr-index-per-content-type.patch | 894 bytes | gnindl |
#1 | apachesolr-mark_all_by_content_type-2463995-1.patch | 1.18 KB | bjpritch |
Comments
Comment #1
bjpritch CreditAttribution: bjpritch commentedComment #2
gnindl CreditAttribution: gnindl commented@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....
Comment #4
bjpritch CreditAttribution: bjpritch commented@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"
Comment #5
bjpritch CreditAttribution: bjpritch commentedComment #6
jgrubb CreditAttribution: jgrubb commentedWorks just fine for me.
Comment #8
jgrubb CreditAttribution: jgrubb commented