Atlas Search Index with Only Documents That has Specific Field Value

Hello,
I want to create Atlas Search Index with filter option, is it possible to do it? For example, I have a collection with metadata field and I want to do search on it only when it’s equal to “1234” for other documents it shouldn’t make any research. I will implement this for langchain similarity search.

{
      name: index,
      definition: {
        "mappings": {
          "fields": {
            "embedding": [
              {
                "dimensions": 1536,
                "similarity": "euclidean",
                "type": "knnVector"
              }
            ]
          }
        }
      }
    }

Hey @Dilara_Bayar,

Based on my knowledge, it is possible to configure your Atlas Search index definition on one specific field. Here is the sample syntax for your reference:

{
  "mappings": {
    "dynamic": true,
    "fields": {
      "<field-name>": {
        "type": "knnVector",
        "dimensions": 1536,
        "similarity": "euclidean"
      }
    }
  }
}

However, configuring the index based on just a single value is not currently supported. May I ask what specific use case you are trying to accomplish using the Atlas vector search?

Regards,
Kushagra

1 Like