public function buildSearchPhrase()
    {
        $cleanSearchStringParts = array();
        $tagsAgainst = $this->buildTagsAgainst();
        $searchString = trim($this->pObj->piVars['sword']);
        $searchString = $this->checkAgainstDefaultValue($searchString);
        $searchStringParts = $this->explodeSearchPhrase($searchString);
        foreach ($searchStringParts as $key => $part) {
            $part = trim($part, '\~+-*|"');
            if (!empty($part)) {
                $cleanSearchStringParts[$key] = $part;
            }
        }

        $searchArray = array(
            'sword' => implode(' ', $cleanSearchStringParts), // f.e. hello karl-heinz +mueller
            'swords' => $cleanSearchStringParts, // f.e. Array: hello|karl|heinz|mueller
            'wordsAgainst' => implode(' ', $searchStringParts), // f.e. +hello* +karl* +heinz* +mueller*
            'tagsAgainst' => $tagsAgainst, // f.e. Array: +#category_213# +#color_123# +#city_42#
            'scoreAgainst' => implode(' ', $cleanSearchStringParts) // f.e. hello karl heinz mueller
        );

        return $searchArray;
    }
public function buildSearchPhrase()
    {
        $cleanSearchStringParts = array();
        $tagsAgainst = $this->buildTagsAgainst();
        $searchString = trim($this->pObj->piVars['sword']);
        $searchString = $this->checkAgainstDefaultValue($searchString);
        $searchStringParts = $this->explodeSearchPhrase($searchString);
        foreach ($searchStringParts as $key => $part) {
            $part = trim($part, '\~+-*|"');
            if (!empty($part)) {
                $cleanSearchStringParts[$key] = $part;
            }
        }

        $searchArray = array(
            'sword' => implode(' ', $cleanSearchStringParts), // f.e. hello karl-heinz +mueller
            'swords' => $cleanSearchStringParts, // f.e. Array: hello|karl|heinz|mueller
            'wordsAgainst' => implode(' ', $searchStringParts), // f.e. +hello* +karl* +heinz* +mueller*
            'tagsAgainst' => $tagsAgainst, // f.e. Array: +#category_213# +#color_123# +#city_42#
            'scoreAgainst' => implode(' ', $cleanSearchStringParts) // f.e. hello karl heinz mueller
        );

        return $searchArray;
    }
public function buildSearchPhrase ( ) { $ cleanSearchStringParts = array ( ) ; $ tagsAgainst = $ this -> buildTagsAgainst ( ) ; $ searchString = trim ( $ this -> pObj -> piVars [ 'sword' ] ) ; $ searchString = $ this -> checkAgainstDefaultValue ( $ searchString ) ; $ searchStringParts = $ this -> explodeSearchPhrase ( $ searchString ) ; foreach ( $ searchStringParts as $ key => $ part ) { $ part = trim ( $ part , '\~+-*|"' ) ; if ( ! empty ( $ part ) ) { $ cleanSearchStringParts [ $ key ] = $ part ; } } $ searchArray = array ( 'sword' => implode ( ' ' , $ cleanSearchStringParts ) , // f.e. hello karl-heinz +mueller 'swords' => $ cleanSearchStringParts , // f.e. Array: hello|karl|heinz|mueller 'wordsAgainst' => implode ( ' ' , $ searchStringParts ) , // f.e. +hello* +karl* +heinz* +mueller* 'tagsAgainst' => $ tagsAgainst , // f.e. Array: +#category_213# +#color_123# +#city_42# 'scoreAgainst' => implode ( ' ' , $ cleanSearchStringParts ) // f.e. hello karl heinz mueller ) ; return $ searchArray ; }
build search phrase
@return array Array containing different elements which helps to build the search query
build search phrase