Index Boost along with sort not working

I have a query, which will fired against 2 indices A & B. Results from index A is more important than B.
ES version : 7.8.0
Query::

{
  "query": {
    "terms": {
      "id": ["a5af38bf-63ac-4e26-af25-68044ffea298","a5af38bf-63ac-4e26-af25-68044ffea298"]
    }
  },
  "sort": [
    {
      "name": "asc"
    }
  ],
  "indices_boost": [
    {
      "A": 1.4
    },
    {
      "B": 1.0
    }
  ]
}

But because of sort, results are coming from index B. I need it from A.
Please help!

Thanks

Please use markdown and formatting in your posts, this is really hard to read. This forum fully supports code snippets. Thank you!

If you want to prefer index a, you either should not sort or just execute a multi search with two searches, one against each index and prefer the first result if it exists over the second.

Hope this helps!