1


in PHP Drupal, I wish to make a request which looks in the field 'field_xxx' with several identifying: id=106 AND id=105 (like a filter).
I tried diverse solutions unsuccessfully.
Could anybody help me? Thank you very much

$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';
Co.Fe
  • 21
  • 1
  • 6

1 Answers1

0

I think the terms query will be useful.

Have a look at this

Community
  • 1
  • 1
pratikvasa
  • 1,897
  • 20
  • 24