This popular Levantine dish is a real old favourite of mine. It's one of my childhood flavours, and evokes memories of heaps of this stuff being sold both in restaurants and by street vendors. Whether eaten hot or cold, the combination of sweet spices and bitter-sweet onion is as comforting as can be. Spoon over some Greek yoghurt and tuck in, but watch out – it's not easy to stop. Serves four.

250ml sunflower oil

4 medium onions, thinly sliced

250g green or brown lentils

2 tsp cumin seeds

1½ tbsp coriander seeds

200g basmati rice

2 tbsp olive oil

½ tsp ground turmeric

1½ tsp ground allspice

1½ tsp ground cinnamon

1 tsp sugar

Salt and black pepper

350ml water

Heat the sunflower oil in a medium-size heavy-based saucepan. When very hot, carefully add a third of the sliced onion. Fry for five to seven minutes, stirring occasionally with a slotted spoon, until the onion takes on a nice, golden-brown colour and turns crispy. Use the spoon to transfer the onion to a colander and sprinkle with salt. Repeat with two more batches of onion.

Meanwhile, put the lentils in a small saucepan, cover with plenty of water, bring to a boil and cook for 12-15 minutes, or until the lentils have softened but still have a little bite. Drain into a colander.

Wipe clean the saucepan in which you fried the onion and drop in the cumin and coriander seeds. Place over a medium heat and toast the seeds for a minute or two, until they release those distinctive aromas. Add the rice, olive oil, turmeric, allspice, cinnamon, sugar, half a teaspoon of salt and plenty of black pepper. Stir to coat the rice with oil, then add the cooked lentils and water. Bring to a boil, cover and simmer on very low heat for 15 minutes.

Remove from the heat, lift off the lid and cover the pan with a clean tea towel. Seal tightly with the lid and set aside for 10 minutes. Finally, tip the rice and lentils into a large mixing bowl. Add half the fried onion and stir gently with a fork. Pile up in a shallow serving bowl and top with the rest of the onion.

• Yotam Ottolenghi is chef/patron of Ottolenghi in London.