Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Adding literal 'null' check. #107

Merged
merged 2 commits into from
Mar 11, 2024
Merged

Conversation

jzonthemtn
Copy link
Collaborator

@jzonthemtn jzonthemtn commented Mar 8, 2024

Adding literal 'null' check for #106.

I'm on the fence if a literal string value of "null" should be considered equal to a null value, but this change ignores the query ID if the literal value of "null" is received and instead generates a new query ID.

To test:

./gradlew build
docker-compose build && docker compose up
./index-chorus-data.sh 

curl -X PUT "http://localhost:9200/_plugins/ubi/awesome?index=ecommerce&id_field=name"
curl -vvvv http://localhost:9200/ecommerce/_search -H "X-ubi-store: awesome" -H "X-ubi-query-id: null" 

Output:

*   Trying 127.0.0.1:9200...
* Connected to localhost (127.0.0.1) port 9200 (#0)
> GET /ecommerce/_search HTTP/1.1
> Host: localhost:9200
> User-Agent: curl/7.81.0
> Accept: */*
> X-ubi-store: awesome
> X-ubi-query-id: null
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< query_id: 5d403d69-c5ee-4d33-ac24-8571c2a31f2c                <----- a query ID was assigned
< Access-Control-Expose-Headers: query_id
< content-type: application/json; charset=UTF-8
< content-length: 16012

Copy link
Member

@epugh epugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get the on the fence!

@jzonthemtn jzonthemtn merged commit ac5cec9 into main Mar 11, 2024
1 check passed
@jzonthemtn jzonthemtn deleted the adding-null-string-value-check branch March 11, 2024 17:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants