elastic-scout-driver-plus icon indicating copy to clipboard operation
elastic-scout-driver-plus copied to clipboard

Retrieve Raw Elasticsearch Data

Open miyake-123 opened this issue 1 year ago • 1 comments

Hi! I have problem getting the data. the available methods such as: searchQuery($query)->execute()->hint(); searchQuery($query)->execute()->models(); searchQuery($query)->execute()->documents();

Do not provide a way to retrieve the raw data array as it appears in the content when calling searchQuery($query)->execute()->documents();. It could be great to have the same features than execute()->documents(): public function toArray(): array { return $this->content; } instead of public function toArray(): array { return [ 'id' => $this->id, 'content' => $this->content, ]; }

miyake-123 avatar May 22 '24 08:05 miyake-123

Hi @miyake-123, do I understand correctly that you want to retrieve only the content of all documents? You can do it as follows: searchQuery($query)->execute()->documents()->map->content().

babenkoivan avatar Jun 06 '24 06:06 babenkoivan

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Jul 07 '24 01:07 github-actions[bot]