In development I've run into the need to delete just one content type from the index. In the general case, I think this translates to a need to make arbitrary queries and delete them from the index (like uid:5, or tid:10). Should get built in a way that will support Drush support later (ie abstract and API'ified enough that Drush has easy way to tie in).

CommentFileSizeAuthor
#1 drush.patch8.06 KBrobertdouglass

Comments

robertdouglass’s picture

Title: Delete a content type from index » Delete a content type from index. Mark a content type for reindexing.
StatusFileSize
new8.06 KB

I'm changing the function signatures for the following:

function apachesolr_rebuild_index_table($type = NULL)
function apachesolr_delete_index($type = NULL)

Both now take an optional parameter that represents a single content type.

Additionally I added drush support to call these functions from the command line:

$ # delete whole index
$ drush solr delete index

$ # delete pages, stories and forums
$ drush solr delete index page story forum

$ # mark entire index to be reindexed
$ drush solr reindex

$ # mark stories and images for reindexing
$ drush solr reindex story image
</pre>
robertdouglass’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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