Elasticsearch vs OpenSearch: source lines of code compared

The Elasticsearch vs OpenSearch comparison on OctoCounts shows side-by-side source line counts for elastic/elasticsearch and opensearch-project/OpenSearch, counted under the rules and on the dates stated below: files, total lines, code lines, comment lines, blank lines, and per-language totals, pinned to the exact commits listed below.

This page compares the source lines of code (SLOC) of elastic/elasticsearch and opensearch-project/OpenSearch using cached OctoCounts reports. Code size is not code quality: a larger count only means more source material, not a better or worse project.

As of 2026-11-24, elastic/elasticsearch contains 4,688,278 total lines (3,368,978 code) across 23,251 files, while opensearch-project/OpenSearch contains 1,980,389 total lines (1,210,057 code) across 10,674 files as of 2026-11-24. elastic/elasticsearch has about 2.8x the counted code lines of opensearch-project/OpenSearch under the same engine and counting rules. Code size is not code quality: a larger count only means more source material, not a better or worse project.

Metricelastic/elasticsearchopensearch-project/OpenSearch
Files23,25110,674
Total lines4,688,2781,980,389
Code lines3,368,9781,210,057
Comment lines804,284536,165
Blank lines515,016234,167
Languages counted2418

Top languages in elastic/elasticsearch: Java (91.5% of code), C Header (3.8% of code), JSON (2.0% of code). Top languages in opensearch-project/OpenSearch: Java (91.7% of code), Rust (6.5% of code), JSON (0.9% of code). Java, JSON, Groovy appear in both top language lists; C Header, C++ appear only in elastic/elasticsearch's top languages; Rust, YAML appear only in opensearch-project/OpenSearch's top languages.

Methodology: both counts come from cached OctoCounts reports generated with tokei. elastic/elasticsearch was counted at ref main (commit 90c621769707) on 2026-11-24; opensearch-project/OpenSearch was counted at ref main (commit f5d1f5a09666) on 2026-11-24. See the counting methodology for ignored directories and analysis options.

Both reports use the same engine and effective counting rules. Repository declarations, when enabled, are specific to each repository. elastic/elasticsearch: tokei-15.0.0, policy directories-v1; docs excluded, tests excluded, generated excluded. Excluded directory names: .cache, .generated, .git, .next, __tests__, build, dist, doc, docs, documentation, fixtures, gen, generated, node_modules, target, test, tests, vendor. Ignored languages: none. Repository declarations: off. Exclusions are rule-based; they do not prove that every test, document or generated file was removed. opensearch-project/OpenSearch: tokei-15.0.0, policy directories-v1; docs excluded, tests excluded, generated excluded. Excluded directory names: .cache, .generated, .git, .next, __tests__, build, dist, doc, docs, documentation, fixtures, gen, generated, node_modules, target, test, tests, vendor. Ignored languages: none. Repository declarations: off. Exclusions are rule-based; they do not prove that every test, document or generated file was removed.

About this comparison

Background observations recorded on 2026-09-16; language descriptions here are historical context, not claims about the current filtered shares. Use this page's measured language breakdown for current counts. Repository layout before counting filters: elastic/elasticsearch is the Elasticsearch repository: the search and analytics engine, predominantly Java, with its modules, plugins (including the X-Pack sources), and test suites. opensearch-project/OpenSearch is the OpenSearch repository — a search and analytics engine, also predominantly Java, that forked from an earlier Elasticsearch release and has since developed independently. Both repositories therefore include engine, modules, and in-tree plugins, taken on the dates shown above.

The per-language tables are dominated by Java on both sides — expected, since OpenSearch descends from the same codebase lineage and the two projects have continued in the same implementation language since the fork.

Both repositories carry their plugin and module code inside the main tree, so a meaningful share of each count is extension surface — security, aggregation, and ingest modules — rather than the core engine alone.

The fork point matters when comparing: OpenSearch split from Elasticsearch at an earlier version, so equal-looking totals hide years of independent change in both directions. Treat the counts as two snapshots, not as a shared-codebase measurement, and check the count dates in the methodology line.

Sources: elastic/elasticsearch repository (engine, modules, and in-tree plugins) · opensearch-project/OpenSearch repository. Statements verified 2026-09-16.

Evidence and next steps:

Saved reports remain subject to cache cleanup and replacement. Export their JSON for durable citation; live report URLs can change.

Note: code size is not code quality. OctoCounts only reports reproducible line counts and makes no claim that either project is better.

Compare FAQ

Which has more lines of code, elastic/elasticsearch or opensearch-project/OpenSearch?

As of 2026-11-24, elastic/elasticsearch contains 4,688,278 total lines (3,368,978 code) across 23,251 files, while opensearch-project/OpenSearch contains 1,980,389 total lines (1,210,057 code) across 10,674 files as of 2026-11-24. elastic/elasticsearch has about 2.8x the counted code lines of opensearch-project/OpenSearch under the same engine and counting rules. Code size is not code quality: a larger count only means more source material, not a better or worse project.

Does more source lines of code mean more complexity?

Not necessarily. SLOC measures size, not complexity, quality, or maintainability. A larger codebase can mean more features, more generated or vendored code, more verbose language idioms, or more tests — none of which imply the code is harder to work with. Use SLOC to gauge the scale of what you'd be reading or maintaining, not as a quality signal for elastic/elasticsearch, opensearch-project/OpenSearch, or any repository.

How is this comparison calculated?

Methodology: both counts come from cached OctoCounts reports generated with tokei. elastic/elasticsearch was counted at ref main (commit 90c621769707) on 2026-11-24; opensearch-project/OpenSearch was counted at ref main (commit f5d1f5a09666) on 2026-11-24. See the counting methodology for ignored directories and analysis options.

Can I compare a different branch, tag, or commit?

Yes. This page shows the default branch for each repository. Use the interactive comparison tool to pick any public GitHub repository, branch, tag, or commit SHA for both sides and get a fresh side-by-side report.