setSort"HREF="function.swishsearch-setsort.html"> Manuál PHP Předcházející Další (no version informatio..."/>
Forum und email
SwishSearch->setPhraseDelimiter

SwishSearch->setPhraseDelimiter

(no version information, might be only in CVS)

SwishSearch->setPhraseDelimiter -- Set the phrase delimiter

Popis

void SwishSearch->setPhraseDelimiter ( string delimiter )

Varování

Tato funkce je EXPERIMENTÁLNÍ. Chování této funkce, její název a všechno ostatní, co je zde zdokumentováno, se v budoucích verzích PHP může BEZ OHLÁŠENÍ změnit. Berte to v úvahu a používejte tuto funkci na vlastní nebezpečí.

Seznam parametrů

delimiter

Phrase delimiter character. The default delimiter is double-quotes.

Návratové hodnoty

Nevrací se žádná hodnota.

Příklady

Příklad 1. Basic SwishSearch->setPhraseDelimiter() example

<?php

try
{

    
$swish = new Swish("index.swish-e");
    
$search = $swish->prepare();

    
$results = $search->execute('"every time"'); //looking for "every time"
    
echo "First query found: ", $results->hits, " hits\n";

    
$search->setPhraseDelimiter("'");
    
$results = $search->execute("'every time'"); //the same query, but using different delimiter
    
echo "Second query found: ", $results->hits, " hits\n";

    
$search->setPhraseDelimiter('"');
    
$results = $search->execute("'every time'"); //looking for "every" and "time"
    
echo "Third query found: ", $results->hits, " hits\n";

    
//let's look at parsed words
    
var_dump($results->getParsedWords("index.swish-e"));

}
catch (SwishException $e) {
    echo
$e->getMessage(), "\n";
}

?>

Výše uvedený příklad vypíše něco jako:

First query found: 1 hits
Second query found: 1 hits
Third query found: 2 hits
array(2) {
  [0]=>
  string(5) "every"
  [1]=>
  string(4) "time"
}