# nearVector search on 3d vector space returns unexpected results

**URL:** <https://forum.weaviate.io/t/nearvector-search-on-3d-vector-space-returns-unexpected-results/379>\
**Category:** Support\
**Created:** [July 17, 2023, 3:12am UTC](https://forum.weaviate.io/t/nearvector-search-on-3d-vector-space-returns-unexpected-results/379 "2023-07-17T03:12:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![scottcame](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@scottcame](https://forum.weaviate.io/u/scottcame)\
**Post date:** [July 17, 2023, 3:12am UTC](https://forum.weaviate.io/t/nearvector-search-on-3d-vector-space-returns-unexpected-results/379/1 "2023-07-17T03:12:09Z")

</div>

Hi there. I am completely new to Weaviate and experimenting with loading and querying some simple objects. Each object has properties x, y, and z, each of which is a number, and a 3d vector consisting of these same numbers.

Here is my schema:

```auto
{
      'class': "XYZ",
      'description': 'A 3d vector class',
      'vectorizeClassName': false,
      'vectorizer': 'none',
      'properties': [
        {
          'name': 'x',
          'dataType': ['number'],
          'description': 'x',
          'vectorizePropertyName': false
        },
        {
          'name': 'y',
          'dataType': ['number'],
          'description': 'y',
          'vectorizePropertyName': false
        },
        {
          'name': 'z',
          'dataType': ['number'],
          'description': 'z',
          'vectorizePropertyName': false
        },
      ]
    }

```

I load 1000 randomly-generated objects, and they seem to load fine:

```auto
curl -s "http://localhost:8080/v1/objects?class=XYZ&limit=1&include=vector" | jq .
{
  "deprecations": [],
  "objects": [
    {
      "class": "XYZ",
      "creationTimeUnix": 1689563219367,
      "id": "00d3baec-56ec-43eb-b860-4958afc8da07",
      "lastUpdateTimeUnix": 1689563219367,
      "properties": {
        "x": 178,
        "y": 840,
        "z": 330
      },
      "vector": [
        178,
        840,
        330
      ],
      "vectorWeights": null
    }
  ],
  "totalResults": 1
}

```

However, I find that regardless of the `vector` property that I pass in my `nearVector` query, I always get the same top-n results back:

```auto
echo '{
    "query": "{
      Get{
        XYZ(
          nearVector: {
            vector: [100, 100, 100]
          }
          limit: 1
        ){
          x
          y
          z
        }
      }
    }"
  }' | curl -s -X POST -H 'Content-Type: application/json' -d @- http://localhost:8080/v1/graphql | jq .
{
  "data": {
    "Get": {
      "XYZ": [
        {
          "x": 454,
          "y": 552,
          "z": 508
        }
      ]
    }
  }
}

```

and

```auto
echo '{
    "query": "{
      Get{
        XYZ(
          nearVector: {
            vector: [800, 800, 800]
          }
          limit: 1
        ){
          x
          y
          z
        }
      }
    }"
  }' | curl -s -X POST -H 'Content-Type: application/json' -d @- http://localhost:8080/v1/graphql | jq .
{
  "data": {
    "Get": {
      "XYZ": [
        {
          "x": 454,
          "y": 552,
          "z": 508
        }
      ]
    }
  }
}

```

Can someone help point me to where I’m going wrong?

Thanks!  
–Scott

---

<div class="post-metadata">

**Author:** ![Dirk](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dirk/32/46_2.png) [@Dirk](https://forum.weaviate.io/u/Dirk)\
**Post date:** [July 17, 2023, 8:03am UTC](https://forum.weaviate.io/t/nearvector-search-on-3d-vector-space-returns-unexpected-results/379/2 "2023-07-17T08:03:03Z")

</div>

Hi, the HNSW is not good with random data. If you want to test it you need something more realistic such as the SIFT dataset: [http://corpus-texmex.irisa.fr/](http://corpus-texmex.irisa.fr/)

---

<div class="post-metadata">

**Author:** ![scottcame](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@scottcame](https://forum.weaviate.io/u/scottcame)\
**Post date:** [July 17, 2023, 2:48pm UTC](https://forum.weaviate.io/t/nearvector-search-on-3d-vector-space-returns-unexpected-results/379/3 "2023-07-17T14:48:03Z")

</div>

Thanks. Can you recommend a good resource on what the “shape” of the vectors/dataset needs to be to get effective results? All real-world data has some randomness in it, so I’m wondering if there are degrees of randomness that are acceptable?

---

<div class="post-metadata">

**Author:** ![Dirk](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dirk/32/46_2.png) [@Dirk](https://forum.weaviate.io/u/Dirk)\
**Post date:** [July 17, 2023, 3:14pm UTC](https://forum.weaviate.io/t/nearvector-search-on-3d-vector-space-returns-unexpected-results/379/4 "2023-07-17T15:14:17Z")

</div>

Can’t answer that in general, but I ran into a similar problem when writing a test recently and [what I did here](https://github.com/weaviate/weaviate/blob/14548a7c4a4aab48ac1348f991a7a11dd250e205/test/acceptance_with_go_client/search_test.go#L266) worked
