opensearch-project / opensearch-project/opensearch-java

[FEATURE] Support for composing query variants from 3rd party plugins

Open
#540 9 comments 4 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

Is your feature request related to a problem?

Some plugins such as the OpenSearch LTR plugin add additional query variants https://elasticsearch-learning-to-rank.readthedocs.io/en/latest/searching-with-your-model.html#searching-with-ltr.

opensearch-java current cannot support construction of a query containing such a query variant as QueryVariant interface requiring a kind being specified and Query.Kind being a enum, not allowing for variants to be specified in a 3rd party client.

What solution would you like?

There would be a couple possible solutions to this problem. Converting the enum to a type which allows for open extension might be one. Add a custom variant to the enum which itself allows for a flexible query construction might be another.

What alternatives have you considered?

See above

Do you have any additional context?

N/A

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 by reading java-client/src/main/java/org/opensearch/client/opensearch/_types/query_dsl/QueryVariant.java and Query.java, then compare the OpenSearch LTR plugin's query variant requirements. Determine how the current kind handling limits third-party variants; done means a third-party plugin query can be composed through the Java client without breaking existing query variants.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.