Grind the pistachios in a food processor until finely chopped (but before they turn to butter). Stir pistachios together with the flour and set aside. If your pistachios aren’t salted (mine were), add a pinch of salt here.
Using an electric mixer (bowl or stand), beat together the butter, sugar, and vanilla bean until light and fluffy, about 3 minutes. If using vanilla extract instead, add in after the butter and sugar has creamed. With the mixer on medium, add in part of the whisked egg (as in, whisk a whole egg, then measure out only 2 tablespoons). Mix until combined.
With the mixer on low, add in the dry ingredients in two batches. Mix just long enough for the dough to come together.
Scrape the dough onto a piece of plastic wrap and form into a disk. Cover and chill in the refrigerator for an over or overnight.
When ready to roll, preheat the oven to 325F. Line baking sheets with parchment paper and set aside.
Divide the dough in half and roll between two sheets of parchment paper until about ⅛-inch thick. Use a flutted biscuit cutter to cut out the cookies. Use a small heart (or whatever shape of your choice), to cut out centers from half of the cookies. Using a small offset spatula, carefully move the cookies to the prepared baking sheets and bake for 10 to 15 minutes, or until the edges start to turn slightly golden.
Repeat with the remaining dough, gathering up the scraps and re-rolling.
Once cooled, spread raspberry jam on the bottom halves (those without a cut-out). Place the tops on a piece of parchment or cutting board and dust with powdered sugar. Carefully sandwich the cookies together and enjoy!
Cookies are best served within in a few hours of assembly, but I definitely still ate them days after (storing at room temperature in an air-tight container).