You are here

public function DoubleQuoteWorkaround::decodeStreamingExpressionValue in Search API Solr 8.2

Same name and namespace in other branches
  1. 8.3 src/Plugin/search_api/processor/DoubleQuoteWorkaround.php \Drupal\search_api_solr\Plugin\search_api\processor\DoubleQuoteWorkaround::decodeStreamingExpressionValue()
  2. 4.x src/Plugin/search_api/processor/DoubleQuoteWorkaround.php \Drupal\search_api_solr\Plugin\search_api\processor\DoubleQuoteWorkaround::decodeStreamingExpressionValue()

Decode a streaming expression value.

Parameters

string $value:

Return value

string|NULL

Overrides SolrProcessorInterface::decodeStreamingExpressionValue

1 call to DoubleQuoteWorkaround::decodeStreamingExpressionValue()
DoubleQuoteWorkaround::postprocessSearchResults in src/Plugin/search_api/processor/DoubleQuoteWorkaround.php
Postprocess search results before they are returned by the query.

File

src/Plugin/search_api/processor/DoubleQuoteWorkaround.php, line 109

Class

DoubleQuoteWorkaround
Replaces double quotes in field values and query to work around a bug in Solr streaming expressions.

Namespace

Drupal\search_api_solr\Plugin\search_api\processor

Code

public function decodeStreamingExpressionValue(string $value) {
  return preg_replace('/' . preg_quote($this->configuration['replacement'], '/') . '/u', '"', $value);
}