@Elliot Sawyer thanks for your reply, but I'm afraid this is a different think. What I was referring was if I search for "foo bar" I want to set a max distance between those two tokens so that for example given the corpus"*foo* lorem ipsum dolor sit amet, consectetur adipiscing elit bar" it is not pulled because those tokens are too far one from the other.
@Kishore Nallan thanks for the clarification!