SwishSearch->setPhraseDelimiter
(PECL swish:0.1-0.3.0)
SwishSearch->setPhraseDelimiter — Set the phrase delimiter
Description
void SwishSearch->setPhraseDelimiter
( string $delimiter
)
Warning
Αυτή η συνάρτηση είναι ΔΟΚΙΜΑΣΤΙΚΗ. Η συμπεριφορά της, το όνομα της και οτιδήποτε άλλο είναι τεκμηριωμένο σχετικά με αυτή την συνάρτηση μπορεί να αλλάξει χωρίς ειδοποίηση σε μελλοντικές εκδόσεις της PHP. Χρησιμοποιήστε αυτή την συνάρτηση με δικό σας ρίσκο.
Parameters
- delimiter
-
Phrase delimiter character. The default delimiter is double-quotes.
Return Values
No value is returned.
Παραδείγματα
Example#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";
}
?>
The above example will output something similar to:
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" }