You need to just merge the current query for the search with the part you want to add which you came close to doing already.
I assume you have a custom taxonomy called media and you specifically want to leave out posts with the term media (like a term found in a tag or category) in the search results
In your case:
$custom_query = array();
$custom_query['tax_query'][] = array( 'taxonomy' => 'media', 'terms' => array('media'), 'field' => 'slug', 'operator' => 'NOT IN' );
$args = array_merge( $wp_query->query, $custom_query );
query_posts( $args );
Related Posts:
- Can I force WP_Query to return no results?
- Custom Search Not Consistent with Results
- How to make search for posts using get method?
- How do I get my custom query to work with search results after the first page?
- Search.php – return number of results but cannot loop through
- Custom search (wp query by custom fields)
- Help with showing text when something is entered in my search bar
- Resetting post data to previous loop in nested loops
- Some doubts about how the main query and the custom query works in this custom theme?
- Post_count only shows the number of results per page
- Get post count of current loop when using multiple queries on one page
- Multiple WP_Query loops with Pagination
- Using a custom WP_Query with get_template_part loop
- WP Query where title begins with a specific letter
- WP_Query vs get_posts
- Loop within a loop?
- WP_Query and next_posts_link
- Show posts without term
- Usage of the new “posts_clauses” filter in WordPress 3.1?
- Display products from specific category in shop page
- How to list some posts first in the loop based on post id
- Pagination returns 404 after page 20
- Search custom taxonomy term by name
- Make loop display posts by alphabetical order
- WP_Query: query posts by ids from array?
- Use WP_Query with have_posts()?
- get custom post type by tag
- How to get order of posts?
- Order posts by ID in the given order
- Order Search Results Page by meta_value If no Value Return Remaining Results
- Too slow when using both ‘tax_query’ and ‘meta_query’ both in WP_Query
- get_template_part in for loop
- Get array of posts from the current archive page loop
- pre_get_posts with get_posts
- How-to exclude terms from the main query the most performant way?
- Pagination with WP_Query is buggy – working for some pages, but not the others
- Get the number of posts from the current page results
- Executing Queries in tag.php
- Display posts the match taxonomy term linked from wp_list_categoies?
- How can I save an array from a random post sequence for later use?
- How to place a loop within another loop?
- WordPress Custom Query to show posts from last x years
- Tracing the life of a query
- How to order posts tag by tag?
- Want to redirect if search query match exact title of any post
- Query Custom Meta Value with Increment
- “pre_get_posts” firing on every query
- Show two random posts from custom post type
- Add the “active” class only to the first loop item in a WordPress query [closed]
- Loop through all tags & output posts in alphabetical list
- Pagination with 5 posts per page
- Identify which loop you are hooking into; primary or secondary?
- In loop: posts have thumbnail AND other variables
- Group posts by custom field
- Pagination not working for Custom search form & custom result template
- How to order category.php loop by ‘meta_value’?
- How to support multiple search terms query within one process?
- Pagination/infinite scroll with WP_Query and multiple loops
- Merging a complex query with post_rewind and splitting posts into two columns
- Sort posts by custom taxonomy name
- Add inline HTML to posts published within last 24hrs
- Pagination broken when merging search results with additional WP_Query
- Move posts to top of WP_Query if in certain Taxonomy?
- Custom search form with empty parameters
- How to search by title or tags exclusively?
- Loop inside the loop
- WordPress search exact match
- Pagination wont work with search results template [duplicate]
- Pagination Not working on Home Page with 2 Query
- meta_query not working properly
- Ajax Infinite Scroll In Custom WP_Query Loop Not Working
- How do I search WordPress by different fields without a plugin?
- Multiple keyword search
- Display different number of posts from one category on the different pages
- Looping through tabular data
- Trying to list out child pages with WP_Query
- Using next/previous_posts_link with customised search
- Exclude post on loop by multiple meta key value
- Pagination not working Search posts
- How to change a custom query into a standard loop?
- WordPress custom search form with pre_get_posts not work
- Search – Ajax – Alter Query Parameters with Pagination
- Transient pagination not working properly
- Show default content if custom WP_Query has no posts
- get_posts() seemingly ignoring post_type
- cloning a WP_Query
- Injecting content with $wp_query->current_post restarts from zero on paged pages. How to inject content after X posts, regardless of pagination?
- How to query ‘posts_per_page’ to display a different blog posts index template?
- Search widget breaks when using multiple loops?
- Add custom search results to main WP search [duplicate]
- Display featured products through custom loop in WooCommerce 3 [closed]
- Woocommerce custom loop to show all the products [closed]
- Sort by meta key on archive page
- Exclude first 5 posts of specific categories in the main loop
- How to bring specific post to front of wordpress loop?
- meta_query on a date range using an array of values
- How to display 3 different loops in 3 columns on homepage
- How is WP_Query connected to WP_Post in The Loop?
- Multiple search queries on one page
- tax_query shows no results if nothing is selected