"score + count(likes) * 0.1"
, which combines a scorer score with a count of the number of likes values times 0.1. A default value must be specified for the expression.
SortExpression expr = SortExpression.newBuilder() .setExpression(String.format( "%s + count(likes) * 0.1", SortExpression.SCORE_FIELD_NAME)) .setDirection(SortExpression.SortDirection.ASCENDING) .setDefaultValueNumeric(0.0) .build()
|
|