Thanks for the reply.
I actually solved the issue by overriding setFreqCurrentDoc() function of
SpanScorer to give boost (by adding extra frequency) if the span positions
are found within chosen distance after one another. I had to override
SpanQuery and SpanWeight as well, just to accept multiple
"a BooleanQuery, but it requires me to consider every possible pair of terms
(since any one of the terms could be missing)"
What about setting minMatch and all the terms as "SHOULD" - and then
minMatch could be tuned for how many missing terms to tolerate?
See:
http://lucene.apache.org/core/4