I finally got a solution by making some changes in my code while saving the post I was storing the courses as a string like: ” 100, 200, 300 ” and If user enters a keyword if that keyword matches with a course then I am getting that corresponding course ID and then using the WP_Query with the following parameters:
$args = array(
'post_type' => 'messages',
'meta_query' => array (
'relation' => 'AND',
array(
'key' => 'inistitute_name',
'value' => array ($institute_name),
'compare' => 'IN'
),
array(
'key' => 'course', //course values stored as ID's like 200, 300 in database
'value' => $keyword, //Single course ID if user types 'java' then I can get only single course ID
'compare' => 'LIKE'
)
),
'posts_per_page' => -1,
'paged' => $paged,
'post_status' => $status,
);
$the_query = new WP_Query($args);
Previously what was the mistake I did is while saving the post I was storing the multiple course names as numeric array itself that causes MySql engine to store that array Serializable string which is difficult to search. But now I am saving the multiple course names as a string separated by commas like this : 123, 456, 789