Skip to content

error message for unquoted TermQuery over datetime field is unhelpful #3409

@trinity-1686a

Description

@trinity-1686a

Describe the bug
TermQuery and TermSetQuery are not parsed properly when using the search api. Term works fine when using the ES compatible api.

Steps to reproduce (if applicable)
Steps to reproduce the behavior:

  1. create an index with a datetime field
  2. run a query such as created_at:[2022-05-01T15:19:33Z TO 2022-05-01T15:19:33Z], it works
  3. run a query such as {"query":{"term":{"created_at":{"value":"2022-05-01T15:19:33Z"}}}} on the ES api, it works
  4. run a query such as created_at:2022-05-01T15:19:33Z, you get an error: Error: { "message": "Internal error: Failed to parse query: created_at:2022-05-01T15:19:33Z.`." }

Expected behavior
the request should succeed.

Configuration:
Please provide:

  1. Output of quickwit --version
  2. The index_config.yaml
version: 0.4

index_id: gh-archive-numericid-light

doc_mapping:
  field_mappings:
    - name: id
      type: u64
      fast: true
    - name: org
      type: json
      tokenizer: default
      type: datetime
      fast: true
      input_formats:
        - rfc3339
      precision: seconds
  timestamp_field: created_at

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions