0Pricing
Elasticsearch & Full Text Search Systems · 강의

버킷 집계

용어, 범위, 날짜와 같은 필드를 기준으로 문서를 '버킷'으로 그룹화하여 패싯 검색과 데이터 분류를 가능하게 합니다.

버킷 집계은(는) CoddyKit의 무료 Elasticsearch & Full Text Search Systems 강의입니다. 이것은 4개 중 2번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Elasticsearch & Full Text Search Systems 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Elasticsearch & Full Text Search Systems 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

Grouping Your Data with Buckets

Welcome to Bucket Aggregations! In Elasticsearch, aggregations allow you to analyze your data.

Bucket aggregations specifically group documents into sets, or 'buckets', based on field values. Think of it like the GROUP BY clause in SQL.

  • Categorize data: Group products by brand.
  • Faceted search: Show counts for different filters.
  • Analyze trends: See activity per day or month.

Finding Unique Values with Terms

The terms aggregation is one of the most common bucket aggregations. It finds the top unique values for a specific field and then counts how many documents fall into each unique value's bucket.

It's incredibly useful for seeing the distribution of categorical data, like product categories, user roles, or country names.

Example: Products by Category

Let's use a terms aggregation to find the top 5 product categories and the count of products in each. We use .keyword for exact matches on text fields.

GET /products/_search
{
  "size": 0,
  "aggs": {
    "top_categories": {
      "terms": {
        "field": "category.keyword",
        "size": 5
      }
    }
  }
}

Bucketing by Numeric Ranges

The range aggregation allows you to define custom ranges for numeric or date fields. Documents whose field values fall within a defined range are grouped into that bucket.

This is perfect for creating price tiers (e.g., $0-10, $10-50, $50+) or age groups (e.g., 0-18, 19-65, 65+).

Example: Products by Price Range

Here, we define three price ranges: products under $10, between $10 and $50, and over $50. The size: 0 means we only want aggregation results, not actual search hits.

GET /products/_search
{
  "size": 0,
  "aggs": {
    "price_tiers": {
      "range": {
        "field": "price",
        "ranges": [
          { "to": 10.00 },
          { "from": 10.00, "to": 50.00 },
          { "from": 50.00 }
        ]
      }
    }
  }
}

Grouping Data Over Time

When working with time-series data, the date_histogram aggregation is your best friend. It buckets documents into fixed time intervals like minutes, hours, days, or months.

You specify an interval (e.g., 'day', 'month') and Elasticsearch automatically creates buckets for each period, even if no documents exist for a particular period.

Example: Sales Trends by Month

This aggregation groups sales orders by month, allowing you to easily track monthly sales performance. We assume an order_date field of type date.

GET /sales/_search
{
  "size": 0,
  "aggs": {
    "monthly_sales": {
      "date_histogram": {
        "field": "order_date",
        "calendar_interval": "month"
      }
    }
  }
}

Multi-Level Grouping: Nesting Buckets

The true power of bucket aggregations comes from nesting them. You can place one bucket aggregation inside another to create hierarchical groupings.

For example, you might want to see product categories, and then within each category, the price ranges of products. This enables deep, multi-dimensional analysis.

Where Buckets Shine

Bucket aggregations are fundamental for many real-world applications:

  • Faceted Search: Allowing users to filter search results by category, brand, price range, etc.
  • Data Exploration: Discovering patterns and distributions in your data.
  • Dashboards: Building visualizations like bar charts (e.g., sales per month, products per category).
  • Reporting: Generating summary reports based on grouped data.

Bucket Aggregation Quiz

You are analyzing user feedback and want to count how many reviews were submitted each day over the past week. Which aggregation type is most suitable?

Bucket Aggregations Recap

Great job! You've learned about the power of Bucket Aggregations in Elasticsearch.

  • They group documents into logical 'buckets'.
  • terms: Groups by unique field values.
  • range: Groups by custom numeric or date ranges.
  • date_histogram: Groups by fixed time intervals.
  • You can nest them for multi-level analysis.

Next, we'll explore Metric Aggregations, which perform calculations (like sum, avg, min, max) on the data within these buckets!

자주 묻는 질문

“버킷 집계” 강의는 무료인가요?

네 — “버킷 집계” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Elasticsearch & Full Text Search Systems 강의 전체를 잠금 해제할 수 있습니다. Elasticsearch & Full Text Search Systems 강의에는 총 4개의 강의가 포함되어 있습니다.

“버킷 집계”에서 뭘 배우나요?

용어, 범위, 날짜와 같은 필드를 기준으로 문서를 '버킷'으로 그룹화하여 패싯 검색과 데이터 분류를 가능하게 합니다. 브라우저에서 직접 실행하는 실습 코드로 Elasticsearch & Full Text Search Systems을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

Elasticsearch & Full Text Search Systems을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 Elasticsearch & Full Text Search Systems은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 2번째 강의입니다.

“버킷 집계” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 Elasticsearch & Full Text Search Systems 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 Elasticsearch & Full Text Search Systems 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. 지표 집계
  2. 버킷 집계
  3. 파이프라인 집계
  4. 중첩 집계 및 하위 집계
← Elasticsearch & Full Text Search Systems(으)로 돌아가기