Hi @Shreyansh_Jain I found the solution, you need to define the pre-filters when creating the vector index (Search Index in MongoDB Compass) as below:
{
“fields”: [
{
“type”: “vector”,
“path”: “embedding”,
“numDimensions”: 1536,
“similarity”: “cosine”
},
{
“type”: “filter”,
“path”: “price”
},
{
“type”: “filter”,
“path”: “plotSize”
},
{
“type”: “filter”,
“path”: “internalArea”
},
{
“type”: “filter”,
“path”: “beds”
},
{
“type”: “filter”,
“path”: “baths”
}
]
}
The path here is the attribute in the document. You can even filter with sub attributes, like baths.size, if baths is a dictionary type, etc.