# danpaz/bodybuilder

An elasticsearch query body builder :muscle:

Repository: https://github.com/danpaz/bodybuilder
Canonical: https://ross.abutalabs.com/products/bodybuilder
Homepage: http://bodybuilder.js.org
Language: JavaScript
License: MIT
License Family: permissive
Topics: elasticsearch, querydsl, builder, javascript, hacktoberfest
Last push: 2026-01-21T23:18:13+00:00

## Health v2 (maintenance only)
Score: 51/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 63, release rhythm 8, longevity 100
- inputs: {"age_days": 4040, "days_push": 224, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1245, forks 127 (observed 2026-08-28T04:04:07.015302+00:00)

## What it is
Bodybuilder is a small JavaScript library for building Elasticsearch query bodies with a simple, chainable, predictable API. It supports the full Elasticsearch query DSL including queries, filters, aggregations, and suggestions, with compatibility options for Elasticsearch 1.x.

## Use cases
- build complex elasticsearch queries programmatically
- construct elasticsearch query DSL without writing raw JSON
- compose nested queries and aggregations in JavaScript
- generate elasticsearch filter and aggregation bodies
- maintain readable elasticsearch query code in Node.js apps

## When to choose
- you write Elasticsearch queries in JavaScript/Node.js and want a fluent builder instead of hand-written JSON
- you need to dynamically compose queries, filters, and aggregations at runtime
- you want a lightweight dependency with full query DSL coverage

## When to avoid
- you use a different search engine than Elasticsearch
- your queries are static and simple enough to write as plain JSON objects
- you need a client that also handles connections and requests (bodybuilder only builds bodies, it does not send them)

## Facets
- artifact type: library
- maturity: stable
- function: search-engine, developer-tools
- domain: developer-tools, apis
- platform: cross-platform
- tags: elasticsearch, query-builder, querydsl, dsl, search, nodejs, javascript

## Member repositories
- danpaz/bodybuilder (main) score 51

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:07.015302+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T05:08:08.663399+00:00, confidence not recorded.
  - readme: https://github.com/danpaz/bodybuilder (fetched 2026-08-28T04:04:07.015302+00:00, sha 402165e1e231)
  - homepage: http://bodybuilder.js.org (fetched 2026-08-29T12:19:42.747746+00:00, sha 1b438d504cc6)
  - site_page: https://bodybuilder.js.org/docs (fetched 2026-08-29T12:19:42.756656+00:00, sha 3564eadea324)
  - registry_npm: https://registry.npmjs.org/bodybuilder (fetched 2026-08-29T12:19:42.759665+00:00, sha 731f3b560455)
- Data as of 2026-08-30T08:39:29.467469+00:00.
