meilisearch / meilisearch/meilisearch-php

[v1.18.0] Add `queryVector` to search responses and support index renaming

Open
#784 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
Dominant language
PHP
Stars
757
Forks
125
Avg merge
6d 8h
Merged PRs (30d)
2

Description

Context

We want to update the SDK to support Meilisearch 1.18 features.

Description

When search requests include the retrieveVectors parameters, the API responses will now include a queryVector field. We want to update the SDK methods to return this field accordingly.

Additionally, Meilisearch now supports renaming indexes. There are two ways to achieve this. The examples below both demonstrate how to rename indexA to indexB:

# Using index swapping
curl \
  -X POST 'MEILISEARCH_URL/swap-indexes' \
  -H 'Content-Type: application/json' \
  --data-binary '[
    {
      "indexes": [
        "indexA",
        "indexB"
      ],
      "rename": true
    },
  ]'

# Using index update
curl \
  -X PATCH 'MEILISEARCH_URL/indexes/indexA' \
  -H 'Content-Type: application/json' \
  --data-binary '{ "indexUid": "indexB" }'

Tasks

  • Update the search responses to include queryVector when necessary
  • Update the index update method to allow renaming
  • Update the index swapping method to allow renaming
  • Add new test cases to test the implementation
  • Add an example under the rename_an_index_1 YAML key in .code-samples.meilisearch.yaml. It should be the equivalent of this CURL example

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the SDK methods for search responses, index updates, and index swapping, then inspect their existing tests and request/response types. Update the relevant responses and rename options, add test cases, and add the equivalent example under the rename_an_index_1 key in .code-samples.meilisearch.yaml. Done means queryVector is returned when requested and both documented rename paths are supported and tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, search
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.