Skip to content

Latest commit

 

History

History
29 lines (29 loc) · 410 Bytes

2bc57cd3f32b59b0b44ca63b19cdfcc0.asciidoc

File metadata and controls

29 lines (29 loc) · 410 Bytes
response = client.search(
  index: 'image-index',
  body: {
    knn: {
      field: 'image-vector',
      query_vector: [
        1,
        5,
        -20
      ],
      k: 5,
      num_candidates: 50,
      similarity: 36,
      filter: {
        term: {
          "file-type": 'png'
        }
      }
    },
    fields: [
      'title'
    ],
    _source: false
  }
)
puts response