My indexing :-
{
"fields": [
{
"numDimensions": 1536,
"path": "comapnies_embedding",
"similarity": "cosine",
"type": "vector"
},
{
"path": "description",
"type": "filter"
},
{
"path": "line_of_business",
"type": "filter"
}
]
}```
actually i trying to implement vector search but results are not as expected but empty documents coming on top of the result with 9+ vector score, I don't know what's happing but then started looking for filters option there is not an single example for filters.
i am using openai text-embedding-ada-002 for embedding i really dont understand why empty document coming on top,
i actually what i want after search by vector search how can i do search with query
following things is my aggrigation
const queryembedding = await getEmbedding(query);
const aggregation = [
{
$vectorSearch: {
exact: true,
index: 'vector_index',
path: 'comapnies_embedding',
queryVector: queryembedding,
// numCandidates: 100,
limit: 100
},
},
{
$project: {
'companyName': 1,
'employee_count': 1,
industry: 1,
country: 1,
scope: 1,
description: 1,
_id: 1,
comapnyLogo: 1,
'score': {
'$meta': 'vectorSearchScore'
}
}
},
{
$sort: {
score: -1
}
}
];
const toUpdate = await Company.aggregate(aggregation).exec()