19 declare(strict_types=1);
45 $this->max_score = $a_score;
54 $score = $this->result[$a_obj_id][$sub_id][
'score'];
60 $this->result_string = $a_res;
80 foreach ($root->children() as $object) {
81 $obj_id = (string) $object[
'id'];
82 foreach ($object->children() as $item) {
83 $sub_id = (string) $item[
'id'];
86 $score = (string) $item[
'absoluteScore'];
87 $this->result[$obj_id][$sub_id][
'score'] = $score;
90 foreach ($item->children() as $field) {
91 $name = (string) $field[
'name'];
92 $this->result[$obj_id][$sub_id][$name] = (string) $field;
99 public function getTitle(
int $a_obj_id,
int $a_sub_id): string
101 return $this->result[$a_obj_id][$a_sub_id][
'title'] ??
'';
106 return $this->result[$a_obj_id][$a_sub_id][
'description'] ??
'';
109 public function getContent(
int $a_obj_id,
int $a_sub_id): string
111 return $this->result[$a_obj_id][$a_sub_id][
'content'] ??
'';
119 $sub_item_ids = array();
120 if (!isset($this->result[$a_obj_id])) {
123 foreach ($this->result[$a_obj_id] as $sub_item_id =>
$data) {
125 $sub_item_ids[] = $sub_item_id;
128 return $sub_item_ids;
Parses result XML from lucene search highlight.
static getLogger(string $a_component_id)
Get component logger.
getContent(int $a_obj_id, int $a_sub_id)
getDescription(int $a_obj_id, int $a_sub_id)
getTitle(int $a_obj_id, int $a_sub_id)
setResultString(string $a_res)
getRelevance(int $a_obj_id, int $sub_id)
getSubItemIds(int $a_obj_id)
setMaxScore(float $a_score)