I want to know the complete request life cycle of request when we query mongodb atlas for full text search. I know that when we run some aggregation in atlas it goes to mongot and then to lucene. we can consider below query for reference :
db.example.aggregate([
{
"$search": {
"index": "default",
"compound": {
"must": [
...some conditions
],
"filter": [
...some clauses
]
}
}
},
{
"$project": {
...some fields
}
},
{
"$skip": 0
},
{
"$limit": 10
},
{
"$sort": {
"score": 1
}
}
])
I also read in docs that for full text search we have to put all our search criteria inside either : $search or $serachMeta.
What if i use $match after $search in atlas like so. :
db.example.aggregate([
{
"$search": {
"index": "default",
"compound": {
"must": [
...some conditions
],
"filter": [
...some clauses
]
}
}
},
{
"$match": [...some other conditions]
},
{
"$project": {
...some fields
}
},
{
"$skip": 0
},
{
"$limit": 10
},
{
"$sort": {
"score": 1
}
}
])
what changes would come in request liefcycle of query compared to without $match clause and what would be the performance impact if any ?