def _CopySortOptionsToProtocolBuffer(sort_options, params):
 for expression in sort_options.expressions:
  sort_spec_pb = params.add_sort_spec()
  _CopySortExpressionToProtocolBuffer(expression, sort_spec_pb)
 if sort_options.match_scorer:
  scorer_spec = params.mutable_scorer_spec()
  _CopyMatchScorerToScorerSpecProtocolBuffer(sort_options.match_scorer, sort_options.limit, scorer_spec)
  scorer_spec.set_limit(sort_options.limit)
 else:
  params.mutable_scorer_spec().set_limit(sort_options.limit)

def _CopySortOptionsToProtocolBuffer ( sort_options , params ) : for expression in sort_options . expressions : sort_spec_pb = params . add_sort_spec ( ) _CopySortExpressionToProtocolBuffer ( expression , sort_spec_pb ) if sort_options . match_scorer : scorer_spec = params . mutable_scorer_spec ( ) _CopyMatchScorerToScorerSpecProtocolBuffer ( sort_options . match_scorer , sort_options . limit , scorer_spec ) scorer_spec . set_limit ( sort_options . limit ) else : params . mutable_scorer_spec ( ) . set_limit ( sort_options . limit )
copies the sortoptions into the searchparams proto buf .