Adds a facet value to the request.

@param string $facetName
@param mixed $facetValue

@return SearchRequest
437220
public function addFacetValue($facetName, $facetValue)
    {
        if ($this->getHasFacetValue($facetName, $facetValue)) {
            return $this;
        }

        $facetValues = $this->getActiveFacets();
        $facetValues[] = $facetName . ':' . $facetValue;
        $this->setActiveFacets($facetValues);

        $this->stateChanged = true;
        return $this;
    }
385364
protected function applySorting(array $facetParameters)
    {
        $sortingExpression = new SortingExpression();
        $globalSortingExpression = $sortingExpression->getForFacet($this->sorting);

        if (!empty($globalSortingExpression)) {
            $facetParameters['facet.sort'] = $globalSortingExpression;
        }

        return $facetParameters;
    }
623324
@Nonnull
  public FineUploaderBasic addParam (@Nonnull @Nonempty final String sKey, @Nonnull final String sValue)
  {
    ValueEnforcer.notEmpty (sKey, "Key");
    ValueEnforcer.notNull (sValue, "Value");

    m_aRequestParams.put (sKey, sValue);
    return this;
  }
270427
public static MozuUrl getFacetsUrl(String documentListName, String propertyName)
	{
		UrlFormatter formatter = new UrlFormatter("/api/content/documentlists/{documentListName}/facets/{propertyName}");
		formatter.formatUrl("documentListName", documentListName);
		formatter.formatUrl("propertyName", propertyName);
		return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
	}
451053
@Override
    public <T> T asFacet(Class<T> facetType)
    {
        if (facetType == SpanProvider.class)
        {
            return facetType.cast(new SpanProviderFacet());
        }

        if (facetType == SeekableReader.class && _scanner.isBufferedInput())
        {
            return facetType.cast(new SeekableReaderFacet());
        }

        return super.asFacet(facetType);
    }
523872
public function addValue(FeatureValue $value)
    {
        $value->setFeature($this);
        $this->values->add($value);

        return $this;
    }
119322
public function createFacet($name, $forceCreationForm = false)
    {
        $this->om->startFlushSuite();
        $facet = new Facet();
        $facet->setName($name);
        $facet->setForceCreationForm($forceCreationForm);
        $facet->setPosition($this->om->count('Claroline\CoreBundle\Entity\Facet\Facet'));
        $this->initFacetPermissions($facet);
        $this->om->persist($facet);
        $this->om->endFlushSuite();

        return $facet;
    }
277076
public function addAttribute($attributeName, $attributeValue)
  {
    if (!array_key_exists($attributeName, $this->attributes)) {
      $this->attributes[$attributeName] = $attributeValue;
      return true;
    }
    return false;
  }
1228894
public static function add(string $sKey, $mValue, int $iExpire = 86400) {
		return static::conn()->add($sKey, $mValue, $iExpire);
	}
1249739
public function getSearchFacetingFacetLinkUrlParametersUseForFacetResetLinkUrl($defaultIfEmpty = true)
    {
        $useForFacetResetLinkUrl = $this->getValueByPathOrDefaultValue('plugin.tx_solr.search.faceting.facetLinkUrlParameters.useForFacetResetLinkUrl', $defaultIfEmpty);
        return $this->getBool($useForFacetResetLinkUrl);
    }
845320
public final FacetOptions addFacetQuery(SolrDataQuery query) {
		Assert.notNull(query, "Facet Query must not be null.");

		this.facetQueries.add(query);
		return this;
	}
45306
protected function addFacetFilters($arguments)
    {
        $activeFacets = $this->getActiveFacets($arguments);
        $activeFacetsForTemplate = [];
        foreach ($activeFacets as $facetID => $facets) {
            foreach ($facets as $facetTerm => $facetInfo) {
                $facetQuery = $this->getFacetQuery($this->getFacetConfig($facetID), $facetTerm);
                if ('and' === $facetInfo['config']['queryStyle']) {
                    // TODO: Do we really use this part of the condition? Can it be removed?
                    // Alternative query style: adding a conjunction to the main query.
                    // Can be useful when using {!join} to filter on the underlying
                    // records instead of the joined ones.
                    $queryString = $this->query->getQuery();
                    if ($queryString) {
                        $queryString = $queryString.' '.Query::QUERY_OPERATOR_AND.' ';
                    }
                    $queryString .= $facetQuery;
                    $this->query->setQuery($queryString);
                } else {
                    // Add a filter query by default.

                    // Add tag/key when configured to excludeOwnFilter for this facet.
                    // Do not add it otherwise as the additional {!tag …} prepended to the Solr query
                    // will break usage of {!join …} in the query.
                    $queryInfo = ['key' => 'facet-'.$facetID.'-'.$facetTerm];
                    if ($facetInfo['config']['excludeOwnFilter'] && $facetQuery) {
                        $queryInfo['tag'] = $this->tagForFacet($facetID);
                    }

                    $this->query->createFilterQuery($queryInfo)
                        ->setQuery($facetQuery);
                }
                $activeFacetsForTemplate[$facetID][$facetTerm] = $facetInfo;
            }
        }

        return $activeFacetsForTemplate;
    }
1118037
public void addHeader (@Nonnull @Nonempty final String sName, @Nullable final String sValue)
  {
    if (sValue != null)
      _addHeader (sName, sValue);
  }
486218
public function addFacet($name, $query = array())
	{
		$this->facetSet = $this->query->getFacetSet();

		$string = $this->makeQueryString($query);
		$this->facetSet->createFacetQuery($name)->setQuery($string);

		return $this;
	}
949658
public function facet($facet, $by = null, $order = null, $direction = null, $limit = null, $skip = 0)
    {
        $facet = (array) $facet;

        return $this->add('facet', compact('facet', 'by', 'order', 'direction', 'limit', 'skip'), true);
    }
1281398
protected function getActiveFacetValuesFromRequest(SearchResultSet $resultSet, $facetName)
    {
        $activeFacetValues = $resultSet->getUsedSearchRequest()->getActiveFacetValuesByName($facetName);
        $activeFacetValues = is_array($activeFacetValues) ? $activeFacetValues : [];

        return $activeFacetValues;
    }
239676
protected function getFilterParts($facetConfiguration, $facetName, $filterValues)
    {
        $filterParts = [];

        $type = isset($facetConfiguration['type']) ? $facetConfiguration['type'] : 'options';
        $filterEncoder = $this->facetRegistry->getPackage($type)->getUrlDecoder();

        if (is_null($filterEncoder)) {
            throw new \InvalidArgumentException('No encoder configured for facet ' . htmlspecialchars($facetName));
        }

        foreach ($filterValues as $filterValue) {
            $filterOptions = $facetConfiguration[$facetConfiguration['type'] . '.'];
            if (empty($filterOptions)) {
                $filterOptions = [];
            }

            $filterValue = $filterEncoder->decode($filterValue, $filterOptions);
            $filterParts[] = $facetConfiguration['field'] . ':' . $filterValue;
        }

        return $filterParts;
    }