0

我有一个简单的服务,它包含通过 PHP XML-RPC 库进行的DokuWiki 调用(https://www.dokuwiki.org/devel:xmlrpc#accessing_the_xml-rpc_interface )。我正在尝试执行 DokuWiki 搜索,但似乎无法使其正常工作。这是我的服务中的相关功能:

public function search($query)
{
    echo $query . "\n";

    // initialize the new message for the search method call
    $message = new xmlrpcmsg('dokuwiki.search');
    $message->addParam(new xmlrpcval($query, "string"));

    // return message results based on XMLRPC server response
    return $this->getResults( $this->_client->send($message) );
}

private function getResults($response)
{
    if( !$response->faultCode() ) {
       return $response->value();
    }

    throw new Exception( $response->faultString() );
}

我的客户端代码正在根据查询语法进行搜索(此处概述了https://www.dokuwiki.org/search):

function searchWiki($dokuwiki, $search, $ns)
{
   $query = "[ $search @$ns ]";
   return $dokuwiki->search($query);
}

但是,无论搜索查询是什么,它似乎都不会产生任何搜索结果。例如,

Query:
[ user @detailed-manuals ]

Result:
object(xmlrpcval)#5 (3) {
  ["me"]=>
  array(1) {
    ["array"]=>
    array(0) {
    }
  }
  ["mytype"]=>
  int(2)
  ["_php_class"]=>
  NULL
}

即使在全局命名空间中搜索也不会产生任何结果,尽管它应该作为术语“用户”出现任意次数。如果有人可以提供见解,那将是最有帮助的。

4

1 回答 1

0

问题是我需要indexer.php按照下面的链接执行脚本来索引 DokuWiki 安装中的所有页面。运行脚本后,我得到了很多结果。

https://www.dokuwiki.org/indexer

于 2014-01-21T23:52:40.033 回答