elastik-nearest-neighbors icon indicating copy to clipboard operation
elastik-nearest-neighbors copied to clipboard

How create index?

Open arpsyapathy opened this issue 5 years ago • 1 comments

Hello! I try to create index:

POST <elasticsearch host>:9200/_aknn_create 

{
    "_index":   "aknn_models",
    "_type":    "aknn_model",
    "_id":      "twitter_image_search",
    "_source": {
        "_aknn_description": "LSH model for Twitter image similarity search",
        "_aknn_nb_tables": 1,
        "_aknn_nb_bits_per_table": 3,
        "_aknn_nb_dimensions": 1000
    },
    "_aknn_vector_sample": [
        [0.11, 0.22, 0.11],
        [0.22, 0.33, 0.22],
        [0.88, 0.99, 0.33]
    ]
}

But i get error:

{
    "error": {
        "root_cause": [
            {
                "type": "index_out_of_bounds_exception",
                "reason": "Index 3 out of bounds for length 3"
            }
        ],
        "type": "index_out_of_bounds_exception",
        "reason": "Index 3 out of bounds for length 3"
    },
    "status": 500
}

How create index? What i do wrong? Thank you advanced

arpsyapathy avatar Mar 24 '19 20:03 arpsyapathy

I think that is a mistake in README, your aknn_vector_sample shape should be (6, 1000)

vulong3896 avatar May 16 '19 08:05 vulong3896