Skip to content

Commit

Permalink
getting index name refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Firetawnyowl committed Jul 31, 2024
1 parent 0e2d3ca commit 491435f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions php/Job/Space/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,17 @@ public function run(): array
}
}

$index_name = $this->getMapper()->find(
'_vindex',
['id' => $space['id'], 'iid' => $this->index]
)[0]['name'];
$index = $this->getMapper()->findOrFail(
'_vindex', [
'id' => $space['id'],
'iid' => $this->index
]
);

$indexName = $index['name'];

[$total] = $this->getMapper()->client->call(
"box.space.$this->space.index.$index_name:count",
"box.space.$this->space.index.$indexName:count",
$key
);
} catch (Exception) {
Expand Down

0 comments on commit 491435f

Please sign in to comment.