0Pricing
Elasticsearch & Full Text Search Systems · درس

تجميعات مسارات المعالجة

اربط التجميعات معًا لإجراء حسابات على نتائج تجميعات أخرى، وإنشاء مسارات تحليلية متقدمة.

تجميعات مسارات المعالجة درس مجاني في Elasticsearch & Full Text Search Systems على CoddyKit. هذا هو الدرس 3 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Elasticsearch & Full Text Search Systems، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Elasticsearch & Full Text Search Systems 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Intro to Pipeline Aggregations

Welcome to Pipeline Aggregations! So far, we've learned about metric and bucket aggregations.

Pipeline aggregations take things a step further. They operate on the results of other aggregations, allowing you to chain them together for more sophisticated analytics.

Beyond Basic Aggregations

Think of basic aggregations as giving you statistics within each bucket (e.g., total sales per product category).

Pipeline aggregations, on the other hand, allow you to calculate statistics across those buckets or over time. For example, finding the overall total of 'total sales per category'.

Chaining Aggregations

The core idea is chaining. A pipeline aggregation receives its input from another aggregation's output.

  • It processes the results of 'sibling' or 'parent' aggregations.
  • This enables multi-stage analysis, where one calculation feeds into the next.

sum_bucket Aggregation

One common pipeline aggregation is sum_bucket. It calculates the sum of a specified metric across all sibling buckets.

Use case: You've grouped sales by product category and calculated the total sales for each category. Now you want to find the grand total sales across all categories.

sum_bucket in Action

This example first gets total sales per category, then uses sum_bucket to sum those category totals into an overall total. You can send this JSON to Elasticsearch using curl -XGET 'localhost:9200/your_index/_search?pretty' -H 'Content-Type: application/json' -d'...'

{ "size": 0,
  "aggs": {
    "sales_by_category": {
      "terms": { "field": "product_category.keyword" },
      "aggs": {
        "total_sales_per_category": { "sum": { "field": "sales_amount" } }
      }
    },
    "overall_total_sales": {
      "sum_bucket": {
        "buckets_path": "sales_by_category>total_sales_per_category"
      }
    }
  }
}

avg_bucket Aggregation

Similar to sum_bucket, the avg_bucket aggregation calculates the average of a specific metric across all sibling buckets.

Use case: After getting the total sales for each product category, you might want to know the average total sales amount *per category*.

avg_bucket in Action

Here, we use avg_bucket to calculate the average of the 'total sales per category' values. Notice the buckets_path remains the same, pointing to the aggregation whose results we want to average.

{ "size": 0,
  "aggs": {
    "sales_by_category": {
      "terms": { "field": "product_category.keyword" },
      "aggs": {
        "total_sales_per_category": { "sum": { "field": "sales_amount" } }
      }
    },
    "average_sales_per_category": {
      "avg_bucket": {
        "buckets_path": "sales_by_category>total_sales_per_category"
      }
    }
  }
}

min_bucket & max_bucket

Elasticsearch also provides min_bucket and max_bucket pipeline aggregations.

  • min_bucket: Finds the minimum value among the specified metric from all sibling buckets.
  • max_bucket: Finds the maximum value among the specified metric from all sibling buckets.

These work just like sum_bucket and avg_bucket, simply changing the operation.

Understanding buckets_path

The buckets_path parameter is crucial for pipeline aggregations. It tells Elasticsearch which aggregation's output to use as input.

  • It uses a > separator for nested aggregations (e.g., parent_agg>child_agg).
  • You can also reference the document count of a bucket using _count (e.g., sales_by_category>_count).

Pipeline Aggregation Check

Let's check your understanding of pipeline aggregations!

Pipeline Aggregations Recap

Great job! In this lesson, you learned about:

  • What pipeline aggregations are and why they're powerful.
  • How they allow you to perform calculations across the results of other aggregations.
  • Key types like sum_bucket, avg_bucket, min_bucket, and max_bucket.
  • The importance of the buckets_path parameter for referencing aggregation outputs.

Pipeline aggregations enable a deeper level of data analysis in Elasticsearch!

الأسئلة الشائعة

هل درس «تجميعات مسارات المعالجة» مجاني؟

نعم — نص درس «تجميعات مسارات المعالجة» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Elasticsearch & Full Text Search Systems، انتقل إلى CoddyKit PRO. تتضمن دورة Elasticsearch & Full Text Search Systems 4 دروس في المجموع.

ماذا ستتعلم في «تجميعات مسارات المعالجة»؟

اربط التجميعات معًا لإجراء حسابات على نتائج تجميعات أخرى، وإنشاء مسارات تحليلية متقدمة. تتمرن على Elasticsearch & Full Text Search Systems مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Elasticsearch & Full Text Search Systems؟

لا تُشترط خبرة سابقة. Elasticsearch & Full Text Search Systems على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 3 من أصل 4.

كم من الوقت يستغرق درس «تجميعات مسارات المعالجة»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Elasticsearch & Full Text Search Systems هذا؟

نعم. كل درس في Elasticsearch & Full Text Search Systems يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. التجميعات المعيارية
  2. تجميعات الحاويات
  3. تجميعات مسارات المعالجة
  4. التجميعات المتداخلة والتجميعات الفرعية
← العودة إلى Elasticsearch & Full Text Search Systems