Skip to content

Commit

Permalink
Elastic search support
Browse files Browse the repository at this point in the history
  • Loading branch information
remdex committed Mar 11, 2021
1 parent 47d508f commit 080e86e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lhc_web/lib/core/lhchat/searchattr/activestatistic_tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@
)
);

$fieldsSearch['subject_ids'] = array (
'type' => 'text',
'trans' => 'Bot ID',
'required' => false,
'valid_if_filled' => false,
'filter_type' => 'filterin_elastic',
'filter_table_field' => 'subject_ids',
'validation_definition' => new ezcInputFormDefinitionElement(
ezcInputFormDefinitionElement::OPTIONAL, 'int', array( 'min_range' => 1), FILTER_REQUIRE_ARRAY
)
);

$fieldsSearch['timeto'] = array (
'type' => 'text',
'trans' => 'Timeto',
Expand Down
12 changes: 12 additions & 0 deletions lhc_web/lib/core/lhchat/searchattr/chatsstatistic_tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@
)
);

$fieldsSearch['subject_ids'] = array (
'type' => 'text',
'trans' => 'Bot ID',
'required' => false,
'valid_if_filled' => false,
'filter_type' => 'filterin_elastic',
'filter_table_field' => 'subject_ids',
'validation_definition' => new ezcInputFormDefinitionElement(
ezcInputFormDefinitionElement::OPTIONAL, 'int', array( 'min_range' => 1), FILTER_REQUIRE_ARRAY
)
);

$fieldsSearch['timefrom'] = array (
'type' => 'text',
'trans' => 'Timefrom',
Expand Down
4 changes: 4 additions & 0 deletions lhc_web/lib/core/lhcore/lhsearchhandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ public static function getParams($params = array())
if (!empty($inputParams->$key)) {
$filter['filterin'][$field['filter_table_field']] = $inputParams->$key;
}
} elseif ($field['filter_type'] == 'filterin_elastic') {
if (!empty($inputParams->$key)) {
$filter['filterin_elastic'][$field['filter_table_field']] = $inputParams->$key;
}
} elseif ($field['filter_type'] == 'manual') {
$filter = array_merge_recursive($filter, $field['filter_table_field']);
} elseif ($field['filter_type'] == 'filternot') {
Expand Down

0 comments on commit 080e86e

Please sign in to comment.