OpsScorerInitParams is passed into the boolean init(OpsScorerInitParams params) function when developing sort plug-ins in Cava for OpenSearch. The framework creates and injects this object automatically at initialization time — you do not instantiate it yourself.
Use it during init() to declare the fields your scorer needs and to access request context.
Available resources:
OpsDoc— declare the fields your scorer will read at score timeOpsRequest— access information from the current search request
Methods
| Return type | Method | Description |
|---|---|---|
OpsDoc | getDoc() | Returns an OpsDoc object for declaring required fields during initialization. |
OpsRequest | getRequest() | Returns an OpsRequest object for accessing request information. |
Method details
`OpsDoc getDoc()`
Returns an OpsDoc object. Call this method in init() to declare the fields your scorer reads during scoring.
For the full OpsDoc API, see OpsDoc.
`OpsRequest getRequest()`
Returns an OpsRequest object. Use it in init() to read request-level information that your scorer depends on.
For the full OpsRequest API, see OpsRequest.