From my (admittedly limited) experience, it's not the awesome doo-dads in a story that nudge you to hit the books. It's more the little things.
For example, early on in my story, a feast is being laid. A question occurred to me - where did all this food come from? Because, lemme tell ya, my heroine sure the heck didn't prepare it. She's been too busy reading magic books and moping about her tragic life. Who's paying the servants? Etc. Long story short, I'm becoming acquainted with the manorial system. (Hey! C'mon! Someone quiz me on three-field crop rotation!)
But, to echo was cris said about TMI, technically, my question was answered just by reading the blurb on a book jacket about the Middle Ages. My heroine's mage school functions like a medieval manor, much the way a parish did. Great! So, I should press on with the writing then?

*laughs* You poor, naive fool. No, no, no. Now, I have all these books about the manorial system, and I am armed with a highlighter. (Actually, my hope is that I am absorbing some bit of trivia that will hijack whatever niggling question might occur to me, say, in Chapter 6.)
Yeah, your ****-sure space-cowboy hero probably doesn't know how the warp drive on his space cruiser works any more than my heroine knows about three-field crop rotation. (That's what space mechanics and serfs are for, respectively.) So, just start writing your story, until you come up with a question that you would like an answer to, and then do some research. And then, for god's sake, stop.
Now, if you'll excuse me, this post has kept me from my highlighting.