Is there a way to add array of post IDS to set posts to be on top of search results?
Something like adding a param top_post_ids inside the search hool:
$query->set( 'top_post_ids', [45, 78, 94 ] );
If these posts will appear in search results, they should be on top.
Sticky posts would not solve this issue in this case, has to be array of post IDS.
The search is via WordPress Rest Api so I cannot modify the template file where the search is called.
example.com/wp-json/wp/v2/posts?search=car&per_page=12&page=1