Vector Search

Below is an example regarding vector search after the vector was activated and used.

curl -u shiva:shiva -XGET 'localhost:8902/hippo/v1/{table}/_search?pretty' -H 'Content-Type: application/json' -d'{  
  "output_fields": ["book_id"],  
  "search_params": {  
    "anns_field": "book_intro",  
    "topk": 2,  
    "params": {  
      "nprobe": 10  
    },  
    "embedding_index": "ivf_flat_index"  
  },  
  "binary_vectors": [ "00000000", "00001111"],  
  "round_decimal": 2,  
  "only_explain" : false  
}'; 

Result:

{  
  "num_queries" : 2,  
  "top_k" : 2,  
  "results" : [  
    {  
      "query" : 0,  
      "fields_data" : [  
        {  
          "field_name" : "book_id",  
          "field_values" : [  
            1,  
            2  
          ]  
        }  
      ],  
      "scores" : [  
        0,  
        1  
      ]  
    },  
    {  
      "query" : 1,  
      "fields_data" : [  
        {  
          "field_name" : "book_id",  
          "field_values" : [  
            2,  
            1  
          ]  
        }  
      ],  
      "scores" : [  
        0,  
        1  
      ]  
    }  
  ]  
}