Skip to content

Commit

Permalink
test filter query 2
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-sc committed Dec 17, 2024
1 parent d223804 commit 199eee2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Classes/Common/QueryParamsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,21 +248,21 @@ private function setCommonParams(): void
// $value = array('Rochester','Bonn');

if ($key !== 'creators') {
/* $query['body']['query']['bool']['filter'][] = self::getFilter([
$query['body']['query']['bool']['filter'][] = self::getFilter([
'name' => $key,
//'type' => $field['type'],
'type' => 'terms',
'value' => $value
]);*/
]);

// post_filter for multiple selection facettes and OR function to combine results from multiple facettes
$query['body']['post_filter']['bool']['should'][] = self::getFilter([
/* $query['body']['post_filter']['bool']['should'][] = self::getFilter([
'name' => $key,
//'type' => $field['type'],
'type' => 'terms',
'value' => $value
],
);
);*/


} else {
Expand Down
2 changes: 1 addition & 1 deletion Classes/Services/ElasticSearchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function search(array $searchParams, array $settings): Collection
{
$this->init();
$this->params = QueryParamsBuilder::createQueryParamsBuilder($searchParams, $settings)->getQueryParams();

print_r($this->params);
// ToDo: handle exceptions!
$response = $this->client->search($this->params)->asArray();
$aggs = $response['aggregations'];
Expand Down

0 comments on commit 199eee2

Please sign in to comment.