SolrUtils::escapeQueryChars

(PECL solr >= 0.9.2)

SolrUtils::escapeQueryCharsEscapes a lucene query string

说明

public static SolrUtils::escapeQueryChars ( string $str ) : string

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

参数

str

This is the query string to be escaped.

返回值

Returns the escaped string 或者在失败时返回 FALSE.

相关文章
php fribidi 函数 convert a logical string to a visual onephp grapheme 函数 returns part of haystack string from the first occurrence of case insensitive needle to the end of haystackphp zlib 函数 decodes a gzip compressed stringphp zlib 函数 uncompress a compressed stringphp firebird/interbase 函数 free memory allocated by a prepared queryphp informix 函数 writes a string into the slob objectphp ingres 函数 get the type of a field in a query resultphp json 函数 returns the error string of the last json encode or json decode callphp maxdb 函数 returns a string representing the type of connection usedphp maxdb 函数 escapes special characters in a string for use in an sql statement taking into account the current charset of the connectionphp 多字节字符串 函数 setup string and regular expression for a multibyte regular expression matchphp sqlite 函数 escapes a string for use as a query parameterphp mysqlnduhconnection escapes special characters in a string for use in an sql statement taking into account the current charset of the connectionphp quickhashinthash this factory method creates a hash from a stringphp solrdismaxquery directly sets boost query parameter bq php solrdismaxquery specifies the amount of slop permitted on phrase queries explicitly included in the user s query string qf parameter php solrutils parses an response xml string into a solrobjectphp solrutils escapes a lucene query stringphp solrutils prepares a phrase from an unescaped lucene stringphp tokyotyrantquery get the hint string of the query
关注编程学问公众号