opensearch-project / opensearch-project/opensearch-java

[BUG] GetRequest API is not returning featureAttributes as expected

Open
#289 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug good first issue
Dominant language
Java
Stars
165
Forks
250
Avg merge
1d 18h
Merged PRs (30d)
26

Description

What is the bug?

After creating index using IndexRequest, it returns the following response containing featureAttributes:aggregation:sum with "field": "value".

Screen Shot 2022-12-06 at 6 06 17 PM

While retrieving the same index using GetRequest the same field is coming as null. (See under featureAttributes:aggregation.sum)

Screen Shot 2022-12-06 at 1 53 11 PM
How can one reproduce the bug?
  1. Create index with the mapping
IndexRequest<AnomalyDetector> indexRequest = new IndexRequest.Builder<AnomalyDetector>()
            .index(ANOMALY_DETECTORS_INDEX)
            .document(detector)
            .build(); 
  1. Get Index
getResponse = client.get(s -> s.index(ANOMALY_DETECTORS_INDEX).id(detectorId), AnomalyDetector.class);
What is the expected behavior?

GetRequest API should return the attributes which were created using IndexRequest

What is your host/environment?

Operating system, version.

Do you have any screenshots?

If applicable, add screenshots to help explain your problem.

Do you have any additional context?

Add any other context about the problem.

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 anomaly-detectors.json mapping and the IndexRequest/GetRequest examples in the issue, then reproduce the round trip for an AnomalyDetector using the OpenSearch Java client. Compare the created response with the retrieved response, focusing on featureAttributes:aggregation.sum; done means GetRequest returns the attributes created by IndexRequest.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.