opensearch-project / opensearch-project/opensearch-java

[FEATURE] Support predict API, it is missing although is in the API spec

Open
#1,777 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
165
Forks
250
Avg merge
1d 18h
Merged PRs (30d)
26

Description

The predict API is not represented in the Java client, and this would be used heavily if you are doing actions such as caching embeddings outside of indexing and ingest pipeline.

https://docs.opensearch.org/latest/ml-commons-plugin/api/train-predict/predict/

This is in the opensearch-openapi.yaml file

  /_plugins/_ml/_predict/{algorithm_name}/{model_id}:
    post:
      operationId: ml.predict.0
      x-operation-group: ml.predict
      x-version-added: '1.3'
      description: Predicts new data with trained model.
      parameters:
        - $ref: '#/components/parameters/ml.predict___path.algorithm_name'
        - $ref: '#/components/parameters/ml.predict___path.model_id'
        - $ref: '#/components/parameters/_global___query.pretty'
        - $ref: '#/components/parameters/_global___query.human'
        - $ref: '#/components/parameters/_global___query.error_trace'
        - $ref: '#/components/parameters/_global___query.source'
        - $ref: '#/components/parameters/_global___query.filter_path'
      requestBody:
        $ref: '#/components/requestBodies/ml.predict'
      responses:
        '200':
          $ref: '#/components/responses/ml.predict___200'

but not in generated code. Other related methods might be missing.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the predict endpoint definition in opensearch-openapi.yaml and inspect how that specification becomes generated Java client code. Trace a comparable existing ML API method, then verify that the predict operation, path parameters, request body, and response are exposed in the client.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.