Related note:
The patch uses the local isInWindow method rather than Distance.noTimes method
Either implementation should be valid, but each will be faster in different use cases.
isInWindow will be faster for long documents when the query terms appear only rarely. (Complexity: |Q| . window . occurences(Q,d))
Distance.noTimes will be faster when the query terms appear often in a document. (Complexity: |Q| . documentLength-window)
Committed patch and test case for interpretation 'All query terms must be contained within a window of n terms'. Window is set to num_query_terms if window is less than num_query_terms.
Commit 3754.
Resolve?