Swish::__construct

(no version information, might be only in CVS)

Swish::__construct -- Construct a Swish object

说明

void Swish::__construct ( string string index_names )

警告

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

参数

index_names

The list of index files separated by spaces.

错误/异常

Throws SwishException on error.

范例

例 1. A Swish::__construct() example

<?php

try
{
    
$swish = new Swish("index1 index2");
}
catch (SwishException $e) {
    echo
$e->getMessage(), "\n";
}

foreach (
$swish->indexes as $index) {
    
var_dump($index["name"]);
    
var_dump($index["headers"]["Total Words"]);
}

?>

上例的输出类似于:

string(6) "index1"
int(1888)
string(6) "index2"
int(2429)