Currently apachesolr_clean_text() strips out all html tags from the $node->body and replaces them with spaces. This is fine (prevents running words together) but if there a lot of html tags in the content, then a lot of extra space gets added.

This causes problems, especially in apachesolr_index_node_solr_document(). When building the document teaser, truncate_utf8() is used, which could result in empty teasers if there is a lot of space in the cleaned node body.

Attached patch strips extra spaces from cleaned text.

CommentFileSizeAuthor
apachesolr-clean-text.patch712 bytesduellj

Comments

pwolanin’s picture

Looks reasonable, though we be nice if there were a faster function to use.

pwolanin’s picture

Status: Needs review » Fixed

Just did the same for a custom module, so I think this is a needed fix.

committed to both 7.x-1.x and 6.x-3.x

nick_vh’s picture

Status: Fixed » Closed (fixed)