1// query-dsl/bool-query.asciidoc:36
2
3[source, php]
4----
5$params = [
6    'body' => [
7        'query' => [
8            'bool' => [
9                'must' => [
10                    'term' => [
11                        'user' => 'kimchy',
12                    ],
13                ],
14                'filter' => [
15                    'term' => [
16                        'tag' => 'tech',
17                    ],
18                ],
19                'must_not' => [
20                    'range' => [
21                        'age' => [
22                            'gte' => 10,
23                            'lte' => 20,
24                        ],
25                    ],
26                ],
27                'should' => [
28                    [
29                        'term' => [
30                            'tag' => 'wow',
31                        ],
32                    ],
33                    [
34                        'term' => [
35                            'tag' => 'elasticsearch',
36                        ],
37                    ],
38                ],
39                'minimum_should_match' => 1,
40                'boost' => 1,
41            ],
42        ],
43    ],
44];
45$response = $client->search($params);
46----
47