o19s / opensearch-ubi

OpenSearch plugin for User Behavior Insights
Apache License 2.0
6 stars 1 forks source link

Adding query_id to the response headers #43

Closed jzonthemtn closed 9 months ago

jzonthemtn commented 9 months ago

Adding query_id to the response headers for #9.

I'm not sure if this a robust solution and the "right" way to do it, but based on old documentation it should work at least for our purposes right now.

The query ID is set in a query_id header:

curl -v http://localhost:9200/.awesome_events/_search 
*   Trying 127.0.0.1:9200...
* Connected to localhost (127.0.0.1) port 9200 (#0)
> GET /.awesome_events/_search HTTP/1.1
> Host: localhost:9200
> User-Agent: curl/7.81.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< query_id: f2bad461-19cf-41cf-bda5-f6885df0525b                              <------ query_id
< content-type: application/json; charset=UTF-8
< content-length: 502