PHP 5.4.36 Released

SolrUtils::queryPhrase

(PECL solr >= 0.9.2)

SolrUtils::queryPhraseآماده‌سازی عبارت از رشته lucene بدون حذف کاراکترهای گریز

Description

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

آماده‌سازی عبارت از رشته lucene بدون حذف کاراکترهای گریز.

Parameters

str

عبارت lucene.

Return Values

بازگرداندن عبارت مشمول در "".

add a note add a note

User Contributed Notes 1 note

up
0
daniel dot allen at commercialtrucktrader dot com
10 months ago
Doing some tests it would appear that this function also sanitizes input(testing on version above 1.0). And the term "phrase" is not the same as a complete query like "FIELD:THE RIGHT HALF AFTER THE : IS THE PHRASE."

So if you want to search SOME_FIELD:some value with an escape character like +, then you would have to write the code out:

$query  = 'SOME_FIELD:' . SolrUtils::queryPhrase('some value with an escape character like +');

That would properly escape it like:

some value with an escape character like \+

FYI.
To Top