You are here

static function Solr_Base_Query::query_replace in Apache Solr Search 5

Replaces all occurances of $option in $keys.

1 call to Solr_Base_Query::query_replace()
Solr_Base_Query::parse_query in ./Solr_Base_Query.php

File

./Solr_Base_Query.php, line 48

Class

Solr_Base_Query

Code

static function query_replace($keys, $option) {
  $matches = Solr_Base_Query::query_extract($keys, $option);
  if (count($matches) > 0) {
    foreach ($matches as $match) {

      // TODO: Make some sort of name->value container object.
      $found = Solr_Base_Query::make_field(array(
        '#name' => $option,
        '#value' => $match,
      ));
      $keys = str_replace($found, '', $keys);
    }
  }
  return $keys;
}