eager load ActionText as part of Model loading
Article .joins(:action_text_rich_text) .with_rich_text_content_and_embeds .where("action_text_rich_texts.body LIKE ?", "%#{search}%")
or
.where(ActionText::RichText.arel_table[:body].matches("%#{search}%"))