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

The ES compatible API accepts malformed requests #4132

Closed
fmassot opened this issue Nov 14, 2023 · 5 comments
Closed

The ES compatible API accepts malformed requests #4132

fmassot opened this issue Nov 14, 2023 · 5 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@fmassot
Copy link
Contributor

fmassot commented Nov 14, 2023

Example of a request that should return a 400 error:

{"term": {"actor.id": {"value": "95077794"}}}

This is converted into a match all query.

The correct query is:

{"query": {"term": {"actor.id": "95077794"}}}
@fmassot fmassot added bug Something isn't working good first issue Good for newcomers labels Nov 14, 2023
@tuziben
Copy link
Collaborator

tuziben commented Nov 14, 2023

{
    "query": {
        "term": {
            "actor.id": {
                "value": "95077794"
            }
        }
    }
}

BTW, this is also a valid DSL format

@fulmicoton
Copy link
Contributor

Yes ! and we accept both.
https://github.com/quickwit-oss/quickwit/blob/main/quickwit/rest-api-tests/scenarii/es_compatibility/0006-term_query.yaml

I think @fmassot's point is that the doc should probably give the full payload (starting from "query")

@etolbakov etolbakov self-assigned this Nov 20, 2023
@fmassot
Copy link
Contributor Author

fmassot commented Nov 20, 2023

We could add deny_unknown_fields to the search body struct.

@fulmicoton I'm wondering if you did not use it deliberately, can you confirm?

@fulmicoton
Copy link
Contributor

fulmicoton commented Nov 21, 2023

It was not deliberate. We should definitely add it!

@fulmicoton
Copy link
Contributor

Thank you @etolbakov !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants