You are here

private function Solr_Base_Query::rebuild_query in Apache Solr Search 5

Same name and namespace in other branches
  1. 5.2 Solr_Base_Query.php \Solr_Base_Query::rebuild_query()
  2. 6 Solr_Base_Query.php \Solr_Base_Query::rebuild_query()
  3. 6.2 Solr_Base_Query.php \Solr_Base_Query::rebuild_query()
3 calls to Solr_Base_Query::rebuild_query()
Solr_Base_Query::add_field in ./Solr_Base_Query.php
Solr_Base_Query::get_query in ./Solr_Base_Query.php
Solr_Base_Query::remove_field in ./Solr_Base_Query.php

File

./Solr_Base_Query.php, line 267

Class

Solr_Base_Query

Code

private function rebuild_query() {
  $fields = array();
  foreach ($this->_fields as $pos => $values) {
    $fields[] = Solr_Base_Query::make_field($values);
  }
  $join_delim = $this->_field_operator == 'AND' ? ' ' : ' OR ';
  $this->_query = trim(implode($join_delim, array_filter($fields, 'trim')));
  foreach ($this->_subqueries as $id => $data) {
    $operator = $data['#operator'];
    $subquery = $data['#query']
      ->get_query();
    $this->_query .= " {$operator} ({$subquery})";
  }
}