Learning and Scoring queries