Best Index for the Aggregate and GroupBy query

Trying to build an index for the following query for the object below.
{
_id:“idofdocument”,
book: {
_id: “someBookId”,
name: “NoNamed”
},
seller: {
name: “A Book shop”
},
type: “_recent_seller”,
sold: “timestamp”
}

The requirement is to fetch the recent seller per book.
Query: SELECT book._id as bookId, MAX([sold,sell])[1].seller AS seller FROM bucker sell WHERE type=’_recent_seller’ GROUP BY book._id

Index I tried is following which is not covered and is taking 5 seconds to return the data.
create index _idx_recent_seller on bucket(type,book._id,sold) where type = ‘_recent_seller’.

Could you guys help me get this performance improved.

Use the recommendations from this blog:

SELECT s.book._id AS bookId, 
                  MAX([ s.`sold`, s.seller])[1] AS seller 
FROM  `bucket`  AS s
WHERE s.type="_recent_seller"  AND  s.book._id IS NOT NULL
GROUP BY s.book._id;

CREATE INDEX ix1 ON bucket(book._id, `sold` DESC, seller) WHERE type="_recent_seller" ;