Repository: meilisearch/meilisearch
File: crates/meilisearch/tests/dumps/mod.rs (Rust)

Code before:
      "distinctAttribute": null,
      "proximityPrecision": "byWord",
      "typoTolerance": {
        "enabled": true,
        "minWordSizeForTypos": {
          "oneTypo": 5,
          "twoTypos": 9
        },
        "disableOnWords": [],
        "disableOnAttributes": []
      },
      "faceting": {
        "maxValuesPerFacet": 100,
        "sortFacetValuesBy": {
          "*": "alpha"
        }
      },
      "pagination": {
        "maxTotalHits": 1000
      },
      "embedders": {
        "doggo_embedder": {
          "source": "huggingFace",
          "model": "sentence-transformers/all-MiniLM-L6-v2",
          "revision": "e4ce9877abf3edfe10b0d82785e83bdcb973e22e",
          "documentTemplate": "{{doc.doggo}}",
          "documentTemplateMaxBytes": 400
        }
      },
      "searchCutoffMs": null,
      "localizedAttributes": null,
      "facetSearch": true,
      "prefixSearch": "indexingTime"
    }
    "###);

    index
        .search(json!({"retrieveVectors": true}), |response, code| {
            snapshot!(code, @"200 OK");
            snapshot!(json_string!(response["hits"], { "[]._vectors.doggo_embedder.embeddings" => "[vector]" }), @r###"
            [
              {
                "id": 0,
                "doggo": "kefir",
                "_vectors": {
                  "doggo_embedder": {
                    "embeddings": "[vector]",
                    "regenerate": false
                  }
                }
              },

Review comment (suggestion):
since the dump was generated right before importing, its pooling is the newer `useModel`.

Code after:
      "distinctAttribute": null,
      "proximityPrecision": "byWord",
      "typoTolerance": {
        "enabled": true,
        "minWordSizeForTypos": {
          "oneTypo": 5,
          "twoTypos": 9
        },
        "disableOnWords": [],
        "disableOnAttributes": []
      },
      "faceting": {
        "maxValuesPerFacet": 100,
        "sortFacetValuesBy": {
          "*": "alpha"
        }
      },
      "pagination": {
        "maxTotalHits": 1000
      },
      "embedders": {
        "doggo_embedder": {
          "source": "huggingFace",
          "model": "sentence-transformers/all-MiniLM-L6-v2",
          "revision": "e4ce9877abf3edfe10b0d82785e83bdcb973e22e",
          "pooling": "useModel",
          "documentTemplate": "{{doc.doggo}}",
          "documentTemplateMaxBytes": 400
        }
      },
      "searchCutoffMs": null,
      "localizedAttributes": null,
      "facetSearch": true,
      "prefixSearch": "indexingTime"
    }
    "###);

    index
        .search(json!({"retrieveVectors": true}), |response, code| {
            snapshot!(code, @"200 OK");
            snapshot!(json_string!(response["hits"], { "[]._vectors.doggo_embedder.embeddings" => "[vector]" }), @r###"
            [
              {
                "id": 0,
                "doggo": "kefir",
                "_vectors": {
                  "doggo_embedder": {
                    "embeddings": "[vector]",
                    "regenerate": false
                  }
                }