Problem/Motivation

1. At the moment it is hard to find out errors in queries from searching milvus.
2. Vector search is done at `\Drupal\ai_vdb_provider_milvus\Plugin\VdbProvider\MilvusProvider::vectorSearch` but there is no logging or exception catching in this method

Steps to reproduce

1. Create a search query with a broken filter
2. Note that there are no results that get returned but no indication what the error with the filters are.

Proposed resolution

1. Add logging in `\Drupal\ai_vdb_provider_milvus\Plugin\VdbProvider\MilvusProvider::vectorSearch` if the expected data structure is not returned `$data['data']`
2. It appears that a `$data['code']` and `$data['message']` is returned from the request.
So:

    if (isset($data['data'])) {
      return $data['data'];
    }
    $this->getLogger('ai_vdb_provider_milvus_provider')->error(sprintf('Error: %s Message: %s', $data['code'], $data['message']));
    return [];

might be all that is needed.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

richardgaunt created an issue. See original summary.

immaculatexavier made their first commit to this issue’s fork.

richardgaunt’s picture

Status: Active » Needs review

scott_euser made their first commit to this issue’s fork.

scott_euser’s picture

Status: Needs review » Needs work

Added some feedback, thanks!