PHP 手册
上一页 |  | 下一页

# SwishSearch->setPhraseDelimiter

(no version information, might be only in CVS)

SwishSearch->setPhraseDelimiter -- Set the phrase delimiter

## 说明

void SwishSearch->setPhraseDelimiter ( string delimiter )

警告
本函数是实验性的。本函数的行为，包括函数名称以及其它任何关于本函数的文档可能会在没有通知的情况下随 PHP 以后的发布而改变。使用本函数风险自担。

## 参数

`delimiter`

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

## 返回值

无返回值。

## 范例

例 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";
}
?>`

上例的输出类似于：

    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"
    }

上一页 | 起始页 | 下一页
SwishSearch->setLimit | 上一级 | SwishSearch->setSort