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

Add ability to restrict by post status #58

Closed
renatonascalves opened this issue Nov 3, 2023 · 0 comments · Fixed by #59
Closed

Add ability to restrict by post status #58

renatonascalves opened this issue Nov 3, 2023 · 0 comments · Fixed by #59
Assignees
Labels
elasticsearch Requires understanding Elasticsearch enhancement New feature or request php Requires understanding PHP vip-enterprise-search WordPress VIP Enterprise Search integration

Comments

@renatonascalves
Copy link
Contributor

renatonascalves commented Nov 3, 2023

Description

See here, alleyinteractive/archiveless#62, a scenario where this functionality can be useful.

add_action(
	'elasticsearch_extensions_config',
	 function( $es_config ) {
		$es_config
			->restrict_post_statuses( [ 'publish', 'my-custom-status' ] )
			->enable_taxonomy_aggregation( 'category' )
			->enable_taxonomy_aggregation( 'post_tag' );
	 }
);

VIP Search has a hook that it uses to confirm if a post should be indexed or not. This plugin can make use of this hook.

Use Case

See this issue for a use case.

@renatonascalves renatonascalves added the enhancement New feature or request label Nov 3, 2023
@renatonascalves renatonascalves self-assigned this Nov 10, 2023
@renatonascalves renatonascalves added vip-enterprise-search WordPress VIP Enterprise Search integration elasticsearch Requires understanding Elasticsearch php Requires understanding PHP labels Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
elasticsearch Requires understanding Elasticsearch enhancement New feature or request php Requires understanding PHP vip-enterprise-search WordPress VIP Enterprise Search integration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant