A findAndRerank query that does not explicitly ask for a lexical leg should succeed so long as the collection has a vector.
Examples of queries that should work without a lexcial index, but currently fail:
[
{
"findAndRerank": {
"filter": {
},
"projection": {
},
"sort": {
"$hybrid": "I like cheese!"
},
"options": {
"limit": 10,
}
}
},
{
"findAndRerank": {
"filter": {
},
"projection": {
"_id": 1,
"$vectorize": 1
},
"sort": {
"$hybrid": {
"$vectorize": "0-dimensional biomaterials lack inductive properties."
}
},
"options": {
"limit": 20,
"includeScores": false,
"includeSortVector": false
}
}
},
{
"findAndRerank": {
"filter": {
},
"projection": {
"_id": 1,
"name": 1,
"$vectorize": 1
},
"sort": {
"$hybrid": {
"$vector": [
0.030776024
]
}
},
"options": {
"rerankQuery": "I like cheese",
"rerankOn": "content",
"limit": 10,
"hybridLimits": {
"$lexical": 15,
"$vector": 35
},
"includeScores": true,
"includeSortVector": false
}
}
}
]
In the above, non of the explicitly as for a lexical sort.
NOTE: the $lexical in hybridLimits should be ignored if the sort does not ask for a lexical.
below is the user explicitly asking for a lexical sort, this should Fail if the collection does not have an index:
{
"findAndRerank": {
"filter": {
},
"projection": {
"_id": 1,
"$vectorize": 1
},
"sort": {
"$hybrid": {
"$vectorize": "0-dimensional biomaterials lack inductive properties.",
"$lexical": "tissue"
}
},
"options": {
"limit": 20,
"includeScores": false,
"includeSortVector": false
}
}
}
A findAndRerank query that does not explicitly ask for a lexical leg should succeed so long as the collection has a vector.
Examples of queries that should work without a lexcial index, but currently fail:
[ { "findAndRerank": { "filter": { }, "projection": { }, "sort": { "$hybrid": "I like cheese!" }, "options": { "limit": 10, } } }, { "findAndRerank": { "filter": { }, "projection": { "_id": 1, "$vectorize": 1 }, "sort": { "$hybrid": { "$vectorize": "0-dimensional biomaterials lack inductive properties." } }, "options": { "limit": 20, "includeScores": false, "includeSortVector": false } } }, { "findAndRerank": { "filter": { }, "projection": { "_id": 1, "name": 1, "$vectorize": 1 }, "sort": { "$hybrid": { "$vector": [ 0.030776024 ] } }, "options": { "rerankQuery": "I like cheese", "rerankOn": "content", "limit": 10, "hybridLimits": { "$lexical": 15, "$vector": 35 }, "includeScores": true, "includeSortVector": false } } } ]In the above, non of the explicitly as for a lexical sort.
NOTE: the
$lexicalin hybridLimits should be ignored if the sort does not ask for a lexical.below is the user explicitly asking for a lexical sort, this should Fail if the collection does not have an index:
{ "findAndRerank": { "filter": { }, "projection": { "_id": 1, "$vectorize": 1 }, "sort": { "$hybrid": { "$vectorize": "0-dimensional biomaterials lack inductive properties.", "$lexical": "tissue" } }, "options": { "limit": 20, "includeScores": false, "includeSortVector": false } } }