We have around 7 million records in Mongo Atlas. There are multiple text fields in each record. We want to give first priority to AssetName and so on, so we have given priority as below.
filters.append({
'text': {
'path': ['AssetName','JobTitle', 'CompanyName','Industry','CampaignName'],
'query': args['keyword']
}
})
Issues, there are many records where "Assetname" field is not present.
So we are getting results where results are based on CompanyName or JobTitle but not the Assetname.
Out of 7 million, we would have Assetname in 2 million records. The rest of the records do not have Assetname.
How should I write the query so that it gives result matchingAssetname first?