I just read this blog post and, in short, it say that if an SQL server isn\'t doing a good enough job building query plans, then the last thi开发者_JAVA技巧ng you want to do is start hard coding stuff
Summary: I collect the doc ids of all hits for a given search by using a custom Collector (it populates a BitSet with the ids). The searching and getting doc ids are quite fast according to my needs b