Function score and optional weight : avg score is wrong #8992

This should probably be renamed to weightSum as well.