how to use hook_views_query_alter() to modify where condition? I'm trying to modify the where condition of a views query. till now I was successful with altering "order by", but I have no idea how to alter the where condition. I want to check the search_term and if it was in uppercase, transform it to lowercase so the query can find it. also there are some special characters in my language (persian) that I need to replace them before the query runs. anyone can help me where to start or what hooks or views_handlers to use?

&lt;?php
/**
 * Implementation of hook_views_query_alter
 * @param type $view
 * @param type $query
 */
function nashreneydev_views_query_alter(&amp;$view, &amp;$query) {
  //krumo($query);
  //krumo($view);
  if ($view-&gt;name == 'custom_search') {
    $search_term = $view-&gt;exposed_raw_input['combine'];

    **//$query-&gt;where[0]['conditions'][0]['field']= "?????";**
    $view-&gt;query-&gt;orderby[1]['field'] = "CASE node_type WHEN 'product_display' THEN 1 ELSE 2 END";
    $view-&gt;query-&gt;orderby[1]['direction'] = "ASC";
    $view-&gt;query-&gt;orderby[0]['field'] = "CASE node_title WHEN '".$search_term."' THEN 1 ELSE 2 END";
    $view-&gt;query-&gt;orderby[0]['direction'] = "ASC";
    //krumo($view-&gt;query-&gt;orderby);
  }
}
?&gt;


the devel result for where condition is as follow right now. :views_combine is equal to %s%.


  CONCAT_WS(' ', node.title, ' ', field_data_body.body_value, ' ',
  field_data_field_author.field_author_target_id, ' ',
  field_data_field_translator.field_translator_target_id, ' ',
  field_data_field_book_tags.field_book_tags_tid) LIKE :views_combine
To add a new where clause you can use, add_where

For example : 

$query-&gt;add_where(1,'taxonomy_term_data_node.tid', $value, 'NOT IN');