Searching named vectors from the Javascript graphQL client


I couldn’t find any information for running a nearVector search using the javascript graphQL client when querying a named vector

for a non-named vector, the query would look like this (below):

const response = await client.graphql
  .withFields('name _additional {certainty}')
    vector: [0.1, -0.15, 0.3, ... ]   

Can someone share a sample code showing how a target vector can be specified by name?

Server Setup Information

  • Weaviate Server Version: 1.25.2
  • Deployment Method:
  • Multi Node? Number of Running Nodes:
  • Client Language and Version: js/ts
  • Multitenancy?: yes

Any additional Information

hi @Hugo !

Welcome to our community :hugs:

Check an example here:

For instance:

  var result = await client.graphql
    vector: [1,2,3,4],
    targetVectors: ['title_country'],
  .withFields('title review_body country')

Notice that this is the typescript v2 version, while we already have the v3 that is way better on pretty much all features :wink:

Check here more info on that:

Let me know if this helps!