Dynamic Query Rule Engine