You are here

public function DoubleQuoteWorkaround::encodeStreamingExpressionValue 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::encodeStreamingExpressionValue()
  2. 4.x src/Plugin/search_api/processor/DoubleQuoteWorkaround.php \Drupal\search_api_solr\Plugin\search_api\processor\DoubleQuoteWorkaround::encodeStreamingExpressionValue()

Encode a streaming expression value.

Parameters

string $value:

Return value

string|NULL

Overrides SolrProcessorInterface::encodeStreamingExpressionValue

File

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

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 encodeStreamingExpressionValue(string $value) {
  return preg_replace('/"/u', $this->configuration['replacement'], $value);
}