Mix the flour with the salt and yeast. Then add the olive oil and 3/4 of the water. Stir well with a wooden spoon until the mixture forms a dough ball. Gradually add remaining water and knead into a dough with your hands. Knead the dough for a further 10 minutes until it has an elastic and silky consistency. Spread olive oil over it and leave covered in a warm place for 30 minutes to rise.
In the meantime heat butter in a frying pan. Add onions, salt them lightly and saute for 30 minutes on low-medium heat but don't allow them to brown. Remove from the heat and let them cool.
Preheat the oven to 190 degrees C.
Roll out the pastry nice and thin on a floured work surface, place it on a greased baking tray and prick it several times with a fork. Make the edges of the pastry slightly thicker so the filling doesn't spill over.
Spread the cooled onions over the pastry. Mix all of the remaining ingredients, except the caraway seeds, in a bowl and spread them over the pastry base. Finally, sprinkle with the caraway seeds.
Bake for 30-45 minutes in the preheated oven. Serve while still warm.