I have a simple service that wraps DokuWiki calls (https://www.dokuwiki.org/devel:xmlrpc#accessing_the_xml-rpc_interface) made via the PHP XML-RPC library. I am attempting to perform a DokuWiki search but cannot seem to get it it to work. Here is the relevant functionality in my service:
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() );
}
My client code is making search according to the query syntax (outlined here https://www.dokuwiki.org/search):
function searchWiki($dokuwiki, $search, $ns)
{
$query = "[ $search @$ns ]";
return $dokuwiki->search($query);
}
However, it never seems to yield any search results, not matter what the search query is. E.g.,
Query:
[ user @detailed-manuals ]
Result:
object(xmlrpcval)#5 (3) {
["me"]=>
array(1) {
["array"]=>
array(0) {
}
}
["mytype"]=>
int(2)
["_php_class"]=>
NULL
}
Even searching in the global namespace yields nothing, though it should as the term "user" shows up any number of times. If anyone could offer insight, that would be most helpful.
The issue was that I needed to execute the indexer.php
script to index all of the pages in the DokuWiki installation per the link below. After running the script, I am getting plenty of results.