SwishSearch->setPhraseDelimiter
(no version information, might be only in CVS)
SwishSearch->setPhraseDelimiter -- Set the phrase delimiter
Descrição
void
SwishSearch->setPhraseDelimiter ( string delimiter )
Atenção |
Esta função é
EXPERIMENTAL. Isso quer dizer que o comportamento desta função
e seu nome, incluindo TUDO o que está documentado aqui
pode mudar em futuras versões do PHP, SEM QUALQUER NOTIFICAÇÃO.
Esteja avisado, e use esta função por sua própria conta e risco. |
Parâmetros
delimiter
Phrase delimiter character. The default delimiter is double-quotes.
Valores de retornado
Não há valor retornado.
Exemplos
Exemplo 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"; }
?>
|
O exemplo acima irá imprimir
algo similar a: 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"
} |
|