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-16, elastic/elasticsearch contains 4,616,454 total lines (3,316,772 code) across 22,968 files, while opensearch-project/OpenSearch contains 1,978,488 total lines (1,208,832 code) across 10,662 files as of 2026-11-16. elastic/elasticsearch has about 2.7x 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.
| Metric | elastic/elasticsearch | opensearch-project/OpenSearch |
|---|---|---|
| Files | 22,968 | 10,662 |
| Total lines | 4,616,454 | 1,978,488 |
| Code lines | 3,316,772 | 1,208,832 |
| Comment lines | 791,445 | 535,683 |
| Blank lines | 508,237 | 233,973 |
| Languages counted | 24 | 18 |
Top languages in elastic/elasticsearch: Java (91.4% of code), C Header (3.9% 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 d0146ae54c4d) on 2026-11-16; opensearch-project/OpenSearch was counted at ref main (commit 8b20d26bdb5b) on 2026-11-16. 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.
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.
As of 2026-11-16, elastic/elasticsearch contains 4,616,454 total lines (3,316,772 code) across 22,968 files, while opensearch-project/OpenSearch contains 1,978,488 total lines (1,208,832 code) across 10,662 files as of 2026-11-16. elastic/elasticsearch has about 2.7x 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.
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.
Methodology: both counts come from cached OctoCounts reports generated with tokei. elastic/elasticsearch was counted at ref main (commit d0146ae54c4d) on 2026-11-16; opensearch-project/OpenSearch was counted at ref main (commit 8b20d26bdb5b) on 2026-11-16. See the counting methodology for ignored directories and analysis options.
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.