Q:

wp_query with parameters

I have a custom search page via which I select:
One or ALL categories
One or ALL tags
One or ALL authors
A search string or no search string

On the results page, wp_query works when I have selected values. 
But how do I instruct to set some param as ALL?  How do I set "search ALL categories" for example? 
Maybe I need to break my args and add to them only when I got values?  But how would I do that? 
Thanks. 
EDIT
I modified the wp-query and now stands as follows.  All works great but I do not have paging! 
$args = array( 'order' => 'DESC', 'orderby' => 'date',  'posts_per_page'=> 10 ); 
if ( '0' ! = $category ) { $args['cat'] = $category; } 
if ( '0' ! = $tag ) { $args['tag'] = $tag; } 
if ( '0' ! = $author ) { $args['author'] = $author; } 
if ( '' ! = $search ) { $args['s'] = $search; } 
$the_query = new WP_Query( $args );
while ($the_query-> have_posts()) : $the_query->the_post();
....
endwhile;
wp_pagenavi( array( 'query' => $the_query ) );

A:

Assuming you have variables to hold your custom values for each:

$category
$tag
$author
$search

Then just create an arguments array, and add keys to it conditionally:
$custom_query_args = array(
    // Set any default args here 
    // NOTE: This is where you'd add
    // things like pagination (posts_per_page),
    // order/sort parameters, and the like
    'posts_per_page' => 10,
    'orderby' => 'date',
    'order' => 'DESC'
);

// If user defines $category, add it
if ( '' ! = $category ) {
    $custom_query_args['cat'] = $category;
}
// If user defines $tag, add it
if ( '' ! = $tag ) {
    $custom_query_args['tag'] = $tag;
}

// If user defines $author, add it
if ( '' ! = $author ) {
    $custom_query_args['author'] = $author;
}

// If user defines $search, add it
if ( '' ! = $search ) {
    $custom_query_args['s'] = $search;
}

// Run the query
$custom_query = new WP_Query( $custom_query_args );

Note: how you define $category, $tag, $author, and $search is outside the scope of this answer. 
Edit
If you want to include a meta query (i.e. custom field) parameter, you can do that as well:
Assuming (user-defined) $post_meta_key and (static) $post_meta_key:
// If user defines $post_meta_value, add it
if ( '' ! = $post_meta_value ) {
    $custom_query_args['meta_query'] = array(
        array(
            'key' => $post_meta_key,
            'value' => $post_meta_value,
            'compare' => '=',
        )
    );
}

