Skip to content

Entity mapping not working correctly? #23

@Zeichen32

Description

@Zeichen32

I have try this bundle in a new project, but i cannot get it to work properly.

Maybe i have found a bug, in the MeiliSearchService at linte 218 their is a for-each to iterate over the ids.

$test= $searchService->search($this->getDoctrine()->getManager(), Test::class, 'hello');

https://github.com/meilisearch/meilisearch-symfony/blob/master/src/Services/MeiliSearchService.php#L218

foreach ($ids as $objectID) {

But if i do a var_dump on the $ids array, the array looks like:

array (size=7)
  'hits' => 
    array (size=20)
      0 => 
        array (size=7)
          'objectID' => int 7
          'id' => int 7
          'tag' => string 'hello' (length=5)
          'context' => null
          'actions' => null
          'parameters' => null
          'patterns' => 
            array (size=6)
              ...
      1 => 

If i change the for-each loop to the following, all is working as expected:

foreach ($ids['hits'] as $objectID) {

Is it a bug, or i am doing something wrong?
If it is a bug, i can create a PR to fix the issue.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions