OpsScorerInitParams

更新时间:
复制 MD 格式

OpsScorerInitParams is passed into the boolean init(OpsScorerInitParams params) method when you implement a custom sort plug-in using Cava. It provides access to document and request resources that your plug-in needs during initialization. The framework constructs the object and passes it in automatically — you do not instantiate it yourself.

How it works

Initialization runs once when the plug-in loads. Use OpsScorerInitParams in init() to:

  • Declare the document fields your scoring logic will read — via getDoc()

  • Inspect the incoming search request — via getRequest()

Functions

FunctionReturnsDescription
OpsDoc getDoc()OpsDocGets the document accessor. Call this in init() to declare the attribute fields your scoring logic needs.
OpsRequest getRequest()OpsRequestGets the request accessor. Call this in init() to read parameters from the incoming search request.

Function details

OpsDoc getDoc()

Returns an OpsDoc object. Call this in init() to declare which document attribute fields your plug-in will access during scoring.

For the full OpsDoc API, see OpsDoc.

OpsRequest getRequest()

Returns an OpsRequest object. Call this in init() to retrieve request information.

For the full OpsRequest API, see OpsRequest.