🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
Swish-e是GPL许可的搜索引擎,Swish-e代表“人类的简单Web索引系统-增强”,并且是用于索引和搜索的开源系统。Swish-e本身已获得GPL许可证的许可,其子句允许应用程序 链接到libswish-e库,以使用已发布的API来执行此操作, 而无需调用GPL的病毒式部分。这需要将 链接返回到swish-e源代码。 它在这里: http://swish-e.org 该软件包未维护 [https://pecl.php.net/package/swish](https://pecl.php.net/package/swish). * [Swish :: \_\_ construct](https://www.php.net/manual/en/swish.construct.php)—构造一个Swish对象 * [Swish :: getMetaList](https://www.php.net/manual/en/swish.getmetalist.php)—获取索引的元条目列表 * [Swish :: getPropertyList](https://www.php.net/manual/en/swish.getpropertylist.php)—获取索引的属性列表 * [Swish :: prepare](https://www.php.net/manual/en/swish.prepare.php)—准备搜索查询 * [Swish :: query](https://www.php.net/manual/en/swish.query.php)—执行查询并返回结果对象 * [SwishResult :: getMetaList](https://www.php.net/manual/en/swishresult.getmetalist.php)—获取元条目列表 * [SwishResult :: stem](https://www.php.net/manual/en/swishresult.stem.php)—[阻止](https://www.php.net/manual/en/swishresult.stem.php)给定的单词 * [SwishResults :: getParsedWords](https://www.php.net/manual/en/swishresults.getparsedwords.php)—获取已解析单词的数组 * [SwishResults :: getRemovedStopwords](https://www.php.net/manual/en/swishresults.getremovedstopwords.php)—获取从查询中删除的停用词数组 * [SwishResults :: nextResult](https://www.php.net/manual/en/swishresults.nextresult.php)—获取下一个搜索结果 * [SwishResults :: seekResult](https://www.php.net/manual/en/swishresults.seekresult.php)—将当前[搜寻](https://www.php.net/manual/en/swishresults.seekresult.php)指针设置为给定位置 * [SwishSearch :: execute](https://www.php.net/manual/en/swishsearch.execute.php)—执行搜索并获取结果 * [SwishSearch :: resetLimit](https://www.php.net/manual/en/swishsearch.resetlimit.php)—重置搜索限制 * [SwishSearch :: setLimit](https://www.php.net/manual/en/swishsearch.setlimit.php)—设置搜索限制 * [SwishSearch :: setPhraseDelimiter](https://www.php.net/manual/en/swishsearch.setphrasedelimiter.php)—设置短语定界符 * [SwishSearch :: setSort](https://www.php.net/manual/en/swishsearch.setsort.php)—设置排序顺序 * [SwishSearch :: setStructure](https://www.php.net/manual/en/swishsearch.setstructure.php)—在搜索对象中设置结构标志 例子 ``` try { $swish = new Swish("index.swish-e"); $results = $swish->query("test OR text"); echo "Found ", $results->hits, " results\n"; while ($result = $results->nextResult()) { var_dump($result); break; //break after the first result } } catch (SwishException $e) { echo "Error: ", $e->getMessage(), "\n"; } ```