Add Weight option to function score query

Closes #1071