I have this, I built it programatically:
(( cat1:bobo AND ( ( cat2:jojo ) OR ( cat2:coco ) ) ))
For the sake of debugging, I am looking for a good method that would basically reduce it to least amount of parens needed:
cat1:bobo AND ( cat2:jojo OR cat2:coco )
I'm on C#, but if you have a good technique you've seen, I will port it.