You are here

function Solr_Base_Query::add_subquery in Apache Solr Search 5

Same name and namespace in other branches
  1. 5.2 Solr_Base_Query.php \Solr_Base_Query::add_subquery()
  2. 6 Solr_Base_Query.php \Solr_Base_Query::add_subquery()
  3. 6.2 Solr_Base_Query.php \Solr_Base_Query::add_subquery()

A subquery is another instance of a Solr_Base_Query that should be joined to the query. The operator determines whether it will be joined with AND or OR.

Parameters

$query: An instance of Solr_Base_Query.

$operator: 'AND' or 'OR'

File

./Solr_Base_Query.php, line 165

Class

Solr_Base_Query

Code

function add_subquery(Solr_Base_Query $query, $operator = 'AND') {
  $this->_subqueries[$query
    ->get_query_basic()] = array(
    '#query' => $query,
    '#operator' => $operator,
  );
}