filter / filters bucket aggregations rejected on _elastic/_search and native search

Đang mở
#6,473 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
52/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
elasticsearch, rust
Lĩnh vực
search

Hướng nghiên cứu

Tái hiện request trên cả native search API và endpoint ES-compat _elastic/_search, sau đó lần theo entry point của aggregation parser dành cho bucket aggregations. Triển khai hỗ trợ cho filter và filters với các sub-aggregations, đồng thời xác minh rằng cả hai dạng đều áp dụng các predicate của chúng lên đúng các tập con document, bao gồm cả ví dụ value_count được cung cấp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area:elasticsearch-api area:query

Summary

On 0.8.x, the filter (singular) and filters (plural) bucket aggregations appear to be rejected on both the native search API and the ES-compat _elastic/_search endpoint. This is the canonical Elasticsearch idiom for splitting one search into N sub-buckets, each with its own predicate, and we haven't found a workable equivalent using bool + terms.

Repro (ES-compat)

curl -sS -X POST "$QW/api/v1/_elastic/<index>/_search" \
  -H 'content-type: application/json' \
  -d '{
    "size": 0,
    "aggs": {
      "failed_logins": {
        "filter": { "term": { "event.outcome": "failure" } },
        "aggs": { "c": { "value_count": { "field": "@timestamp" } } }
      }
    }
  }'

Observed behavior

HTTP 400 — agg parser rejects the filter key. Same shape on filters. Reproduces regardless of the inner query (term, bool, query_string, match_all).

Expected behavior

Accept filter and filters with standard Elasticsearch semantics: bucket the matching docs, run sub-aggs only on that subset.

Use case

Stacked-series dashboards where multiple metrics share the same date_histogram axis but each has its own predicate (e.g. "failed logins per hour" alongside "successful logins per hour" on one chart). The only purely-Quickwit alternative is N round-trips, which doesn't compose for shared axes.

Version

Observed on 0.8.x. Have not verified against main — happy to retest if this is already fixed.

Ngôn ngữ chính
Rust
Star
11.8k
Fork
628
Merge trung bình
2 ngày 22 giờ
Pull request đã merge (30 ngày)
50

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của quickwit-oss/quickwit

Tất cả issue của quickwit-oss/quickwit

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.