2017-01-23 79 views
1
在PHP的Drupal


,我希望使看起来在字段 'field_xxx' 与几个识别请求:ID = 106 AND ID = 105(如过滤)。
我尝试过不同的解决方案,但未成功。
有人能帮助我吗?非常感谢弹性搜索1.4和Drupal 7:使用阵列中的查询

$searchParams = [ 
    'index' => 'indextest, 
    'type' => 'index_test', 
    'body' => [ 
     'query' => [ 
      'bool' => [ 
       'must' => [ 
        [ 'match' => [ 'title' => 'the cat' ] ], 
        [ 'match' => [ 'field_xxx' => ['106','105'] ] ], 
       ] 
      ] 
     ] 
    ] 
]; 



$searchParams['body']['query']['match']['title'] = "Le jeu de la dame"; 
$searchParams['body']['query']['bool']['must']['field_support']= '106,105'; 
+0

我想: '术语'=> [ 'field_support'=> '106']]这是确定 –

+0

但我有一个错误:[ '术语'=> [' field_support'=>'106','105']] –

回答