Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for typed_keys in GET asynchronous search API #46

Open
Bukhtawar opened this issue Sep 29, 2021 · 5 comments
Open

Support for typed_keys in GET asynchronous search API #46

Bukhtawar opened this issue Sep 29, 2021 · 5 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@Bukhtawar
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
The typed_keys specify whether aggregation and suggester names should be prefixed by their respective types in the response. Current this is only supported on SUBMIT API. Meaning if the request takes longer, future GET requests do not have an ability to return typed_keys any longer

@Bukhtawar Bukhtawar added the enhancement New feature or request label Sep 29, 2021
@Bukhtawar Bukhtawar self-assigned this Sep 29, 2021
@Bukhtawar Bukhtawar added the bug Something isn't working label Sep 29, 2021
@eirsep
Copy link
Member

eirsep commented Sep 29, 2021

If the typed_keys=True param is set in the Submit API request, we are setting it in the underlying search request which continues to run in the background.

Irrespective of SUBMIT or GET asynchronous search call, the underlying search request and its final response will honor the typed_keys value which was set in the initial call. I don't see how the GET request result is failing to see the expected result.

As it is responsible for building the correct search request, if there is a bug it would be in the submit API itself?
Or are you saying the intermediate/partial results is not honoring typed_keys?

Plz elaborate on this bug. Has it been reproduced?

@aneesh297
Copy link

aneesh297 commented Sep 29, 2021

I'm currently on 7.10. I have this issue.

Irrespective of SUBMIT or GET asynchronous search call, the underlying search request and its final response will honor the typed_keys value which was set in the initial call. I don't see how the GET request result is failing to see the expected result.

In the below request/response, typed_keys is not honored in GET async.

Example submit request:

POST clustername/_opendistro/_asynchronous_search/?wait_for_completion_timeout=15s&keep_on_completion=true&keep_alive=100s&typed_keys
{
  "query": {
    "match_all": {}
  },
  "aggregations": {
    "agg_field_1":{
            "terms":{
                "field":"$cs.agg_field_1$keyword",
                "size":10,
                "min_doc_count":1,
                "shard_min_doc_count":0,
                "show_term_doc_count_error":false,
                "order":[
                    {
                        "_count":"desc"
                    },
                    {
                        "_key":"asc"
                    }
                ]
            }
        }
  }
}

Response aggregations for submit:

"aggregations" : {
      "sterms#agg_field_1" : {
        "doc_count_error_upper_bound" : 0,
        "sum_other_doc_count" : 0,
        "buckets" : [
          {
            "key" : "3",
            "doc_count" : 11253290
          }
        ]
      }
    }

If I try to use Get async for the same id.

GET _opendistro/_asynchronous_search/FnVoVHdzWGo2UzJlduZoS2phSUxmbncINDM1Mzg5yDgUTnJST00zd0JQM8ZxUHJEZWprMEkDMjAz

Response aggregations this time

"aggregations" : {
      "agg_field_1" : {
        "doc_count_error_upper_bound" : 0,
        "sum_other_doc_count" : 0,
        "buckets" : [
          {
            "key" : "3",
            "doc_count" : 11253290
          }
        ]
      }
    }

The field "agg_field_1" is now no longer annotated with the internal type "sterm".

Get async does not accept typed_keys as a parameter.
X-pack Elasticsearch supports typed_keys in GET async api. https://elasticsearch-py.readthedocs.io/en/7.9.1/xpack.html?highlight=typed_keys

@peternied
Copy link
Member

@eirsep what is the state of this issue? Feature complete was declared on #42

@eirsep
Copy link
Member

eirsep commented Nov 17, 2021

This is being targeted for 1.3.
Removing 1.2 tag on this issue.

@eirsep eirsep removed the v1.2.0 label Nov 17, 2021
@w4p
Copy link

w4p commented Apr 18, 2024

I am using OS 2.12 and the issue is still here. Any updates since 2021?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants