I am working on a project which is going to use the elasticsearch very
intensively in future, but i have trouble in implementing the DSL queries
as I am new to both ElasticSearch and Lucene.
I am using PHP
here is example of my code:
$options['query'] = array(
'query' => array(
'filtered' => array(
'query' => array(
'query_string' => array(
'default_field' => 'name',
'query' => $this->search_term . '*',
),
),
'filter' => array(
'and' => array(
array(
'term' => array(
'access_id' => 2,
),
),
),
'not' => array(
array(
'term' => array(
'follower' => 32,
),
),
array(
'term' => array(
'fan' => 36,
),
),
),
),
),
),
);
as this query is meant to search the user with access_id = 2, but must not
have the follower of id 32 and fan of id 36
but this is not working..
Please help thanks.