RethinkDB和PHP-RQL如何同时过滤+匹配

I am very new to PHP-RQL and cannot figure out how do a simple SQL query like this (old method/database):

Method 1 (default view)

$mysql1 = 'SELECT 'html1' FROM  `paging` WHERE `agency` IN ("USER1", "USER2", "USER3") AND `alias` != \'\' ORDER BY  `id` DESC LIMIT 1000';

Method 2 if there was a $_GET['search']; present (user searching)

$mysql2 = " SELECT "html1" FROM  `paging` WHERE  `private` !=  '1' AND  `alias` LIKE  '%". $search . "%' ORDER BY `id` DESC LIMIT 2000"; 

Now those were pretty much the exact elements I was trying to capture from the MySQL we are currently using, but we wish to switch to RethinkDB.

Can someone explain to me how you get multiple WHERE IN clauses in the PHP-RQL client? It is quite a lot different to the way RethinkDB have their docs in Java. I have read the following:

RethinkDB version I have got together so far (does not work at all and I need some help understanding filter and match).

    $agency = "USER1|USER2|USER3";
    $search = (isset($_GET['search']) ? $_GET['search'] : "..");

    require_once("include/rdb/rdb.php");
    $conn = r\connect('127.0.0.1', 28015, "birms");
        $result = r\table('paging')->filter(array(
    'agency' => match->$agency,
    'alias' => match->$search,
    'private' => 'false'))->run($conn);

    foreach ($result as $doc) {
        print_r($doc[$html_src]);
    }

   /* I toyed around with single returns, also didnt work....
    return $doc('agency')->match($agency);
    return $doc('search')->match($search);
    return $doc('private')->match('false');

    This does work; stock standard with no care for the above SQL
    $result = r\table("paging")->orderBy(array('index' => r\desc('js_unique')))->limit(1000)->filter(array('private' => 'false'))->pluck($html_src)->run($conn);
   */

Thankyou.

So, using ->rAnd I was able to solve my question. Here's the code. Hopefully some people can make sense of this.

$agency = "USER1|USER2|USER3";
$search = (isset($_GET['search']) ? $_GET['search'] : "..");

require_once("include/rdb/rdb.php");
$conn = r\connect('127.0.0.1', 28015, "database");

$result = r\table("paging")->filter(function($doc){
global $agency;
global $search;
return $doc('agency')->match($agency)
->rAnd($doc('private')->ne('true'))
->rAnd($doc('alias')->match("(?i){$search}"));
})->orderBy(r\desc('js_unique'))->limit(1000)->pluck($html_src)->run($conn);
    foreach ($result as $doc) {
    print_r($doc[$html_src]);
    }