Reply To: Boosts documentation
You can boost some of your fields in WPSOLR’s screen 2.3
You can boost some of your fields in WPSOLR’s screen 2.3
In the admin, you cannot sort by rankmath fields, only by standard WP fields (date, category, status). WPSOLR can replace media search in WP’s admin media library only.
i see. so is it possible to achieve when trying to sort by rankmath, it will pull data from the database and not from elastic?
WPSOLR provides a hook to deactivate itself in admin search: add_action( WPSOLR_Events::WPSOLR_FILTER_IS_REPLACE_ADMIN_POST_TYPE_BY_WPSOLR_QUERY, [ $this, 'wpsolr_filter_is_replace_admin_post_type_by_wpsolr_query', ], 99, 1 ); public function wpsolr_filter_is_replace_admin_post_type_by_wpsolr_query( $is_replace_by_wpsolr_query ) { $result = $is_replace_by_wpsolr_query && !( condition here on your url parameters or anything you want); return $result; }
You can inspire from wpsolr-pro/wpsolr/core/classes/extensions/premium/class-wpsolr-option-premium.php to eventually filter your own admin fields: add_action( WPSOLR_Events::WPSOLR_ACTION_SOLARIUM_QUERY, [$this,’wpsolr_action_query’,], 10, 1 ); public function wpsolr_action_query( $parameters ) { … }
thanks.. too complicated for me i guess the above hook disables wpsolr totally on wp admin right? i dont want to do that for sure..it extremely improved my admin experience
You can use it to disable WPSOLR in admin only on your own conditions, like the presence of the RankMath fields in the sort query.
can you on help me with that one on custom request?
I sent you an invite with Trello.