TST/DOC: add complex query test and add more thorough doc example for logical negation