Rewrite boolean_query build method to be compatible with version 2013-01-01.