- Модуль: search
- Путь к файлу: ~/bitrix/modules/search/classes/general/search.php
- Класс: CAllSearchQuery
- Вызов: CAllSearchQuery::GetQueryString
function GetQueryString($fields, $query, $bTagsSearch = false, $bUseStemming = true, $bErrorOnEmptyStem = false)
{
$this->m_words = Array();
$this->m_fields = explode(",", $fields);
$this->bTagsSearch = $bTagsSearch;
//In case there is no masks used we'll keep list
//of all tags in this member
//to perform optimization
$this->m_tags_words = array();
$this->m_query = $query = $this->CutKav($query);
//Assume query does not have any word which can be stemmed
$this->bStemming = false;
if (!$this->bTagsSearch && $bUseStemming && COption::GetOptionString("search", "use_stemming") == "Y")
{
//In case when at least one word found: $this->bStemming = true
$stem_query = $this->StemQuery($query, $this->m_lang);
if ($this->bStemming === true || $bErrorOnEmptyStem)
$query = $stem_query;
}
$this->m_parsed_query = $query = $this->ParseQ($query);
if ($query == "( )" || $query == '')
{
$this->error = GetMessage("SEARCH_ERROR3");
$this->errorno = 3;
return false;
}
$query = $this->PrepareQuery($query);
return $query;
}