Add support for span multi term query.

Closes #863.