The dough can be frozen for up to 1 month; thaw before using. Pies can be stored at room temperature overnight.
Make the pastry: Pulse flour, salt, and granulated sugar in a food processor until combined. Add butter, and pulse until mixture resembles coarse crumbs with some larger pieces remaining, about 5 seconds.
Evenly drizzle ice water over mixture. Pulse until mixture just begins to hold together, about 10 seconds. Turn out dough onto plastic wrap, and wrap. Shape into a disk. Refrigerate until firm, about 1 hour or overnight.
Make the filling: Toss pears with lemon juice. Melt butter in a medium skillet over medium-high heat. Add pears, and toss to coat. Cook, adding granulated sugar a little at a time, until pears begin to soften, about 5 minutes. Stir in nutmeg. Transfer to a bowl, and mix in raspberries.
Divide dough in half, and roll out each piece to 1/8-inch thickness on a lightly floured surface. Refrigerate until firm, about 15 minutes.
Preheat oven to 350 degrees. Drain pear-raspberry filling in a sieve. Cut out 20 hearts from dough using a 4-inch cutter, transferring them to a parchment-lined baking sheet. Lightly brush rims of half the hearts with egg wash, and top each with 4 heaping teaspoons filling. Top with remaining hearts, and gently press around sides to seal.
Brush pie tops with egg wash, and sprinkle with sanding sugar. Bake until golden brown, about 40 minutes.
To make circular pies, use a 4-inch round cutter.