# 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 with the same engine and analysis options on the dates shown in the methodology line: files, total lines, code lines, comment lines, blank lines, and per-language totals, pinned to the exact commits listed below.

As of 2026-09-10, elastic/elasticsearch contains 4,300,837 total lines (3,091,605 code) across 21,945 files, while opensearch-project/OpenSearch contains 1,946,225 total lines (1,187,173 code) across 10,538 files as of 2026-09-15. elastic/elasticsearch is about 2.6x the size of opensearch-project/OpenSearch by code lines. Code size is not code quality: a larger count only means more source material, not a better or worse project.

| Metric | [elastic/elasticsearch](https://octocounts.com/github/elastic/elasticsearch) | [opensearch-project/OpenSearch](https://octocounts.com/github/opensearch-project/OpenSearch) |
| --- | ---: | ---: |
| Files | 21,945 | 10,538 |
| Total lines | 4,300,837 | 1,946,225 |
| Code lines | 3,091,605 | 1,187,173 |
| Comment lines | 728,395 | 527,833 |
| Blank lines | 480,837 | 231,219 |
| Languages counted | 12 | 12 |

Top languages in elastic/elasticsearch: Java (91.0% of code), C Header (4.1% of code), JSON (2.1% of code). Top languages in opensearch-project/OpenSearch: Java (91.8% of code), Rust (6.4% of code), JSON (0.9% of code). Java, JSON, YAML appear in both top language lists; C Header, C++ appear only in elastic/elasticsearch's top languages; Rust, Groovy 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 657b990d6944) on 2026-09-10; opensearch-project/OpenSearch was counted at ref f4918fa96dff07545000bba3dc2b0f2c7639910e (commit f4918fa96dff) on 2026-09-15. See the [counting methodology](https://octocounts.com/docs/methodology) for ignored directories and analysis options.
## About this comparison

elastic/elasticsearch counts 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 counts the OpenSearch repository — a search and analytics engine, also predominantly Java, that forked from an earlier Elasticsearch release and has since developed independently. Both counts 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)](https://github.com/elastic/elasticsearch) · [opensearch-project/OpenSearch repository](https://github.com/opensearch-project/OpenSearch). Statements verified 2026-09-16.

Evidence and next steps:

- [elastic/elasticsearch SLOC report](https://octocounts.com/github/elastic/elasticsearch)
- [opensearch-project/OpenSearch SLOC report](https://octocounts.com/github/opensearch-project/OpenSearch)
- [Compare elastic/elasticsearch and opensearch-project/OpenSearch interactively](https://octocounts.com/compare?left=https%3A%2F%2Fgithub.com%2Felastic%2Felasticsearch&right=https%3A%2F%2Fgithub.com%2Fopensearch-project%2FOpenSearch)

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?

elastic/elasticsearch has more code: 3,091,605 code lines versus 1,187,173 for opensearch-project/OpenSearch, about 2.6x as much, based on cached OctoCounts reports as of 2026-09-15.

### 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 657b990d6944) on 2026-09-10; opensearch-project/OpenSearch was counted at ref f4918fa96dff07545000bba3dc2b0f2c7639910e (commit f4918fa96dff) on 2026-09-15. 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.

## Related OctoCounts pages

- [Interactive repository comparison](https://octocounts.com/compare)
- [Recently analyzed repositories](https://octocounts.com/recent)
- [Popular SLOC reports](https://octocounts.com/popular)
- [Trending GitHub repositories](https://octocounts.com/trending)
- [Hall of Monoliths](https://octocounts.com/hall-of-monoliths)
- [Original research: how filtering changes SLOC counts](https://octocounts.com/research)
- [GitHub SLOC counter guide](https://octocounts.com/docs/github-sloc-counter)
- [Counting methodology](https://octocounts.com/docs/methodology)
- [SLOC and code metrics glossary](https://octocounts.com/docs/glossary)
- [OctoCounts API docs](https://octocounts.com/docs/api)
