Proxmity search (group based)

Hi

 i am having the same doubt which you have asked.

 is there any possibility to work like below query

 ((A OR B) AND (C OR D)~5)

Ex:
my expected result = (A OR B) within 5 words of (C OR D)

   if A is the result of first group, C is the result of 2nd group, then A should be with in 5 words of C.