Heat a large 6-quart pot over medium heat and add 2 tablespoons olive oil.
Add the coriander seeds and cumin seeds (or ground cumin), smashed allspice (or ground), cinnamon, turmeric, and black pepper to the pot and sauté the spices for 2–3 minutes until fragrant.
Add the lentils and 6 cups vegetable broth or water, stir to combine, cover, and simmer for 15 minutes.
After 15 minutes, stir in the basmati rice, cover, and simmer another 15 minutes or until the rice is tender and liquid is absorbed.
While the lentils and rice cook, heat a large sauté pan over medium heat and add 1/2 cup vegetable oil.
Toss the sliced onions with 1/4 cup flour to coat evenly.
Once the oil is hot, add the floured onions and stir frequently, sautéing until the onions are soft with dark, crispy edges, about 15 minutes (aim for medium brown).
When the rice and lentils are cooked, transfer them to a serving bowl and top with the caramelized onions.
Sprinkle with chopped cilantro and serve with lemon wedges.