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 bbcode 函数 parse a string following a given rule setphp 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 maxdb 函数 escapes special characters in a string for use in an sql statement taking into account the current charset of the connectionphp sqlite 函数 escapes a string for use as a query parameterphp sqlite 函数 execute a query that does not prefetch and buffer all dataphp mysqlnduhconnection escapes special characters in a string for use in an sql statement taking into account the current charset of the connectionphp mysqlnduhconnection sends a query to mysqlphp mysqlnduhpreparedstatement executes a prepared queryphp normalizer checks if the provided string is already in the specified normalization formphp quickhashinthash this factory method creates a hash from a stringphp 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
关注编程学问公众号