The Query Filters that you can add are determined by the underlying WP_Query Class that WordPress uses to retrieve posts from the database.
You can see the available parameters here: https://developer.wordpress.org/reference/classes/wp_query/#custom-field-post-meta-parameters
You can use comparisons such as equals or greater than, and in your case you've tried to use LIKE which is actually for string matches. There isn't really anything for the use case you describe.
What you really need is to work with the orderby parameters (https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters) where you order by difference from the price of the current post, disregarding sign.
Again, there isn't anything very helpful there. You can only sort by the custom field values, not by some dynamic calculation using the custom field value (e.g. INT(50000 - meta_value) to order the posts by those closest to 50,000).
So, although the request appears simple enough, the implementation is actually quite complex, because of how the underlying WordPress queries work.
You can use the API hook 'wpv_filter_query_post_process' to test and manipulate the View query results before they are output so that you can manually re-order the results and limit as required.
I prepared some sample code you can test on your site. It assumes you have a View created to display these posts, which should only include a Query Filter for the taxonomy, not for the price, and which should contain no setting to limit the number of returned posts.
Then you can try adding the following PHP code (at Toolset > Settings > Code Snippets):
/**
* Re-order View results
*/
add_filter( 'wpv_filter_query_post_process', 'ts_closest_items', 10, 3 );
function ts_closest_items( $query_args, $view_settings, $view_id ){
/** SETTINGS */
$view_ids = array( 123 ); // update with IDs of Views to apply to
$field = 'wpcf-max-price'; // slug of comparison custom field with Types 'wcpf-' prefix
$limit = 3; // how many posts to return
if ( in_array( $view_id, $view_ids ) ) {
global $post;
$base_value = get_post_meta( $post->ID, $field, true );
$results = $query_args->posts;
foreach ($results as $result) {
$value = get_post_meta( $result->ID, $field, true );
$result->value_diff = abs($base_value - $value);
}
usort( $results, "custom_cmp" );
$query_args->posts = array_slice( $results, 0, $limit );
$query_args->found_posts = $limit;
$query_args->post_count = $limit;
}
return $query_args;
}
function custom_cmp($a, $b) {
if ($a->value_diff == $b->value_diff) {
return 0;
}
return ($a->value_diff > $b->value_diff) ? 1 : -1;
}
You will need to edit the first few lines for the ID of the View(s), the field you want to compare, and the number of posts which should be returned.
Let me know how you get on.