Custom scoring for Atlas Search

Hello there, I have the following document structure in my collection movies.

  • title (string)
  • title_synonyms (array with strings)
  • popularity (integer)
  • ranking (integer)
  • soundtracks (embedded document)
    • title (string)
    • number (integer)

The problem here is if I search for a soundtrack (via text search), the wrong movie is returned because the title and title_synonyms often have values wich are kind of near. Is there a way to set how much a field influences the score of a document?

Hi @Richard_N_A,

Welcome to MongoDB community!

To achieve this I would suggest to use the compound syntax to search each field path seperately :
https://docs.atlas.mongodb.com/reference/atlas-search/compound

Now on the field you want to boost you can adjust it scoring by either using score boosting or having a constant score with a high enough value over the others:

https://docs.atlas.mongodb.com/reference/atlas-search/scoring

Best
Pavel