default operator is AND now
[phorkie.git] / src / phorkie / Search / Elasticsearch.php
index 3c3ea83..0ed766b 100644 (file)
@@ -34,7 +34,8 @@ class Search_Elasticsearch
                             'should' => array(
                                 (object)array(
                                     'query_string' => (object)array(
                             'should' => array(
                                 (object)array(
                                     'query_string' => (object)array(
-                                        'query' => $term
+                                        'query' => $term,
+                                        'default_operator' => 'AND'
                                     ),
                                 ),
                                 (object)array(
                                     ),
                                 ),
                                 (object)array(
@@ -42,7 +43,8 @@ class Search_Elasticsearch
                                         'type'         => 'file',
                                         'query' => (object)array(
                                             'query_string' => (object)array(
                                         'type'         => 'file',
                                         'query' => (object)array(
                                             'query_string' => (object)array(
-                                                'query' => $term
+                                                'query' => $term,
+                                                'default_operator' => 'AND'
                                             )
                                         )
                                     )
                                             )
                                         )
                                     )