fix phrase iteration
enable phrase matching in Query

* fix exception when placeholder is used in a phrase