0Pricing
Elasticsearch & Full Text Search Systems · Ders

İç İçe Toplamalar ve Alt Toplamalar

Ölçümleri kovaların içine yerleştirerek toplamaları birleştirmeyi, çok düzeyli analizler oluşturmayı ve iç içe toplama ile iç içe belge yapılarını dolaşmayı öğrenin.

İç İçe Toplamalar ve Alt Toplamalar, CoddyKit'te ücretsiz bir Elasticsearch & Full Text Search Systems dersidir. Bu, 4 dersinin 4. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Elasticsearch & Full Text Search Systems öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Elasticsearch & Full Text Search Systems kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

Combining Aggregations

A single aggregation answers one question. Real analytics often need layered answers: average price per category, or top brands per region. Elasticsearch lets you nest aggregations inside one another.

This lesson shows how to compose them.

The aggs Hierarchy

Any bucket aggregation can contain a sub-aggs block. The sub-aggregation runs once per bucket, operating only on the documents in that bucket.

This is the core mechanism for multi-dimensional analytics.

Metric Inside a Bucket

Here we group documents by category, then compute the average price within each group. The metric aggregation lives inside the bucket aggregation's aggs.

GET sales/_search
{
  "size": 0,
  "aggs": {
    "by_category": {
      "terms": { "field": "category" },
      "aggs": {
        "avg_price": { "avg": { "field": "price" } }
      }
    }
  }
}

Reading the Result

Each bucket in by_category now carries an avg_price value alongside its doc_count. You get the category name, how many docs it holds, and its average price in one response.

Bucket Inside a Bucket

You can nest bucket aggregations too. Group by region, then by brand within each region. This produces a two-level breakdown.

"aggs": {
  "by_region": {
    "terms": { "field": "region" },
    "aggs": {
      "by_brand": { "terms": { "field": "brand" } }
    }
  }
}

Mind the Cardinality

Deeply nested terms aggregations can explode combinatorially. A region with 50 brands across 20 regions yields up to 1,000 buckets. Use the size parameter to limit returned buckets and protect memory.

Multiple Sub-Aggregations

A bucket can hold several sub-aggregations at once. Here each category reports both its average and maximum price.

"by_category": {
  "terms": { "field": "category" },
  "aggs": {
    "avg_price": { "avg": { "field": "price" } },
    "max_price": { "max": { "field": "price" } }
  }
}

The nested Aggregation

When data uses the nested field type, you must enter that scope with a nested aggregation before aggregating on its inner fields. It points at a path.

"aggs": {
  "variants": {
    "nested": { "path": "variants" },
    "aggs": {
      "avg_qty": { "avg": { "field": "variants.quantity" } }
    }
  }
}

Reverse Nested

Inside a nested aggregation you can jump back to the parent document scope using reverse_nested. This lets you count distinct parent docs that contain a matching nested element.

"reverse_nested": {},
"aggs": {
  "parent_count": { "value_count": { "field": "_id" } }
}

Sorting Buckets by a Metric

Order parent buckets by a nested sub-metric using order. Here categories are sorted by their average price, descending.

"terms": {
  "field": "category",
  "order": { "avg_price": "desc" }
}

Design Tips

Keep nesting shallow when possible, always set size on inner terms, and put the most selective bucket aggregation first to reduce the work done by deeper levels.

Quick Check

Test your grasp of sub-aggregations.

Recap

You learned to compose aggregations:

  • Any bucket aggregation can hold sub-aggs that run per bucket.
  • Nest metrics in buckets, or buckets in buckets for multi-level breakdowns.
  • Use the nested and reverse_nested aggregations to traverse nested document scopes.
  • Control bucket explosion with size and order buckets by sub-metrics with order.

Sıkça Sorulan Sorular

“İç İçe Toplamalar ve Alt Toplamalar” dersi ücretsiz mi?

Evet — “İç İçe Toplamalar ve Alt Toplamalar” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Elasticsearch & Full Text Search Systems kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Elasticsearch & Full Text Search Systems kursu toplamda 4 dersten oluşur.

“İç İçe Toplamalar ve Alt Toplamalar” dersinde ne öğreneceğim?

Ölçümleri kovaların içine yerleştirerek toplamaları birleştirmeyi, çok düzeyli analizler oluşturmayı ve iç içe toplama ile iç içe belge yapılarını dolaşmayı öğrenin. Elasticsearch & Full Text Search Systems ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

Elasticsearch & Full Text Search Systems öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te Elasticsearch & Full Text Search Systems, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 4. dersidir.

“İç İçe Toplamalar ve Alt Toplamalar” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu Elasticsearch & Full Text Search Systems dersinde kod yazıp çalıştırabilir miyim?

Evet. Her Elasticsearch & Full Text Search Systems dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. Ölçüm Toplamaları
  2. Kova Toplamaları
  3. Pipeline Toplamaları
  4. İç İçe Toplamalar ve Alt Toplamalar
← Elasticsearch & Full Text Search Systems Sayfasına Dön