Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<SolrUtils::digestXmlResponseSolrUtils::getSolrVersion>
^SolrUtilsLast updated: Mon, 26 Oct 2026

SolrUtils::escapeQueryChars

(PECL solr >= 0.9.2)

SolrUtils::escapeQueryChars — Escapes a lucene query string

Description

public static function SolrUtils::escapeQueryChars(string $str): string|false

Lucene supports escaping special characters that are part of the query syntax.

The current list special characters are:

+ - && || ! ( ) { } [ ] ^ " ~ * ? : \ /

These characters are part of the query syntax and must be escaped

Parameters

str

This is the query string to be escaped.

Return Values

Returns the escaped string or false on failure.


<SolrUtils::digestXmlResponseSolrUtils::getSolrVersion>
^SolrUtilsLast updated: Mon, 26 Oct 2026