You are here

protected function SearchApiDenormalizedEntityGrouping::getFacettingBehavior in Search API Grouping 7.2

Determines the effective value for the "facetting" option.

Depending on whether the legacy "truncate" option was explicitly set by the user, this will choose the right default if the "facetting" option itself is not present.

Return value

string A legal value for this processor's "facetting" option.

2 calls to SearchApiDenormalizedEntityGrouping::getFacettingBehavior()
SearchApiDenormalizedEntityGrouping::configurationForm in includes/processor_grouping.inc
Return the settings form for this processor.
SearchApiDenormalizedEntityGrouping::preprocessSearchQuery in includes/processor_grouping.inc
Set the options so the server adapter can use the to implement grouping.

File

includes/processor_grouping.inc, line 94
Processor for grouping support.

Class

SearchApiDenormalizedEntityGrouping
Processor for grouping up items on behalf of user defined fields.

Code

protected function getFacettingBehavior() {

  // Apply legacy behavior of "truncate" option, if available.
  if (isset($this->options['facetting'])) {
    return $this->options['facetting'];
  }
  return !isset($this->options['truncate']) || $this->options['truncate'] ? 'first_document' : 'documents';
}