opensearch-project / k-NN

🆕 Find the k-nearest neighbors (k-NN) for your vector data
https://opensearch.org/docs/latest/search-plugins/knn/index/
Apache License 2.0
156 stars 123 forks source link

[Feature Request] I have multiple knn_vector fields with settings.index.knn set to true, but it would be ideal if certain fields could use approximate k-NN search while others could only use exact k-NN. #2270

Open bcc829 opened 1 week ago

bcc829 commented 1 week ago

Is your feature request related to a problem? Please describe

In my index, I have two knn_vector fields with settings.index.knn set to true, but I want one field to use approximate k-NN search while the other only uses exact k-NN. The field not using approximate k-NN is consuming a lot of memory. It would be ideal if I could configure the use of approximate k-NN on a per-field basis.

Describe the solution you'd like

It would be nice if it could be set for each field as shown below.

{
  "settings": {
    "index": {
      "knn": true,
    }
  },
  "mappings": {
    "properties": {
      "vector1": {
        "type": "knn_vector",
        "dimension": 2,
        "index": "false"
      },
      "vector2": {
        "type": "knn_vector",
        "dimension": 4,
        "index": "false"
      }
    }
  }
}

Related component

Search

Describe alternatives you've considered

No response

Additional context

No response

sandeshkr419 commented 1 week ago

Does this belongs in k-nn repo - https://github.com/opensearch-project/k-NN/

cc - @navneet1v

navneet1v commented 1 week ago

@sandeshkr419 yes this belongs to k-NN.

@bcc829 there are already some github issues created for to exactly solve this problem: https://github.com/opensearch-project/k-NN/issues/1079, https://github.com/opensearch-project/k-NN/issues/1078

Please do a +1 on the issue and also add your use case so that it can be priortized.

cc: @vamshin

vamshin commented 1 week ago

@sandeshkr419 do you have permissions to move this to k-NN repo?

sandeshkr419 commented 1 week ago

I don't have permissions to move, but @prudhvigodithi mentioned in triage meeting that he can move it (probably maintainer's permissions).

@prudhvigodithi Can you please move this to k-NN plugin?

(I'll add back the untriage label so that k-NN group can acknowledge it)