You are here

protected function SolrBaseQuery::getSingleValueParams in Apache Solr Search 7

Get Single Value params for the base query.

Return value

array

File

./Solr_Base_Query.php, line 369
This class allows you to make operations on a query that will be sent to Apache Solr. methods such as adding and removing sorts, remove and replace parameters, adding and removing filters, getters and setters for various parameters and more

Class

SolrBaseQuery

Code

protected function getSingleValueParams() {
  $single_value_params = array(
    'q' => TRUE,
    // http://wiki.apache.org/solr/SearchHandler#q
    'q.op' => TRUE,
    // http://wiki.apache.org/solr/SearchHandler#q.op
    'q.alt' => TRUE,
    // http://wiki.apache.org/solr/SearchHandler#q
    'df' => TRUE,
    'qt' => TRUE,
    'defType' => TRUE,
    'timeAllowed' => TRUE,
    'omitHeader' => TRUE,
    'debugQuery' => TRUE,
    'start' => TRUE,
    'rows' => TRUE,
    'stats' => TRUE,
    'facet' => TRUE,
    'facet.prefix' => TRUE,
    'facet.limit' => TRUE,
    'facet.offset' => TRUE,
    'facet.mincount' => TRUE,
    'facet.missing' => TRUE,
    'facet.method' => TRUE,
    'facet.enum.cache.minDf' => TRUE,
    'facet.date.start' => TRUE,
    'facet.date.end' => TRUE,
    'facet.date.gap' => TRUE,
    'facet.date.hardend' => TRUE,
    'facet.date.other' => TRUE,
    'facet.date.include' => TRUE,
    'hl' => TRUE,
    'hl.snippets' => TRUE,
    'hl.fragsize' => TRUE,
    'hl.mergeContiguous' => TRUE,
    'hl.requireFieldMatch' => TRUE,
    'hl.maxAnalyzedChars' => TRUE,
    'hl.alternateField' => TRUE,
    'hl.maxAlternateFieldLength' => TRUE,
    'hl.formatter' => TRUE,
    'hl.simple.pre/hl.simple.post' => TRUE,
    'hl.fragmenter' => TRUE,
    'hl.fragListBuilder' => TRUE,
    'hl.fragmentsBuilder' => TRUE,
    'hl.useFastVectorHighlighter' => TRUE,
    'hl.usePhraseHighlighter' => TRUE,
    'hl.highlightMultiTerm' => TRUE,
    'hl.regex.slop' => TRUE,
    'hl.regex.pattern' => TRUE,
    'hl.regex.maxAnalyzedChars' => TRUE,
    'mm' => TRUE,
    'spellcheck' => TRUE,
  );

  // Date change to Range in versions after Solr 5.
  if ($this->solr
    ->getSolrVersion() >= 6) {
    $deprecated_keys = [
      'facet.date.start',
      'facet.date.end',
      'facet.date.gap',
      'facet.date.hardend',
      'facet.date.other',
      'facet.date.include',
    ];
    $new_keys = [
      'facet.range.start',
      'facet.range.end',
      'facet.range.gap',
      'facet.range.hardend',
      'facet.range.other',
      'facet.range.include',
    ];
    $single_value_params = array_merge(array_diff_key($single_value_params, array_flip($deprecated_keys)), $new_keys);
  }
  return $single_value_params;
}