Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content in reusable blocks is not searched #2127

Closed
johnbillion opened this issue Mar 11, 2021 · 3 comments
Closed

Content in reusable blocks is not searched #2127

johnbillion opened this issue Mar 11, 2021 · 3 comments

Comments

@johnbillion
Copy link

Steps to reproduce:

  1. Insert a paragraph into a post containing some unique text
  2. Save the paragraph as a reusable block
  3. Publish the post
  4. On the front end, search the site for the text
  5. Observe there are no results

Reusable blocks can contain content that should be discoverable via search.

This is probably a wider problem that affects shortcodes and server-side rendered blocks too, but let's focus on one thing at a time.

@johnbillion johnbillion added the type:bug Something isn't working. label Mar 11, 2021
@felipeelia
Copy link
Member

Thanks, @johnbillion , I can confirm that bug.

We already index a "translated" version of the post content in the post_content_filtered field. While we don't have a proper fix applied in the plugin, here is a workaround for those with this problem:

add_filter(
	'ep_weighting_configuration_for_search',
	function( $weight_config ) {
		foreach ( $weight_config as &$post_type_config ) {
			if ( isset( $post_type_config['post_content'] ) ) {
				$post_type_config['post_content_filtered'] = $post_type_config['post_content'];
			}
		}
		return $weight_config;
	}
);

@felipeelia felipeelia added confirmed bug needs discussion and removed type:bug Something isn't working. labels Mar 19, 2021
@felipeelia felipeelia added this to the 3.5.7 milestone Mar 19, 2021
@johnbillion
Copy link
Author

Thanks, that's what the Altis team have decided to do too: humanmade/altis-enhanced-search#160

@felipeelia
Copy link
Member

We've created a new article documenting this: https://elasticpress.zendesk.com/hc/en-us/articles/4402857301389

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants