Skip to content

Instantly share code, notes, and snippets.

@nervetattoo
Created October 6, 2010 15:08
Show Gist options
  • Save nervetattoo/613496 to your computer and use it in GitHub Desktop.
Save nervetattoo/613496 to your computer and use it in GitHub Desktop.
<?php
$transport = new ElasticSearchTransportHTTP("localhost", 9200);
$search = new ElasticSearchClient($transport, "1311", "affiliates");
$query = array(
'query' => array(
'bool' => array(
'must' => array(
array(
'query_string' => array(
'query' => "blah",
),
),
array('term' => array('fieldX' => 'valueX')),
array('term' => array('fieldY' => 'valueY')),
)
)
)
);
$a = $search->search($query); // <--- Need to add the 2 DSL terms here
print_r($a);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment