Skip to content

Note the storage tradeoff of copy_to and how to avoid it - #7790

Open
ash9146 wants to merge 5 commits into
elastic:mainfrom
ash9146:copy-to-storage-tradeoff
Open

Note the storage tradeoff of copy_to and how to avoid it#7790
ash9146 wants to merge 5 commits into
elastic:mainfrom
ash9146:copy-to-storage-tradeoff

Conversation

@ash9146

@ash9146 ash9146 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

The "Search as few fields as possible" section shows copy_to purely
as a search-speed optimization, with no mention that the source fields
(name, plot) remain separately indexed alongside the new combined
field. As written, the example adds roughly a third field's worth of
index storage rather than saving any - this tradeoff wasn't documented
anywhere.

Context

size-shards.md already frames copy_to as a way to reduce
per-field mapping overhead:

If a collection of fields are typically used together, consider
using copy_to to consolidate them at index time.

That framing only holds if indexing is disabled on the source fields
once they're only needed via the combined field ("index": false).
This connection wasn't made from search-speed.md, so a reader
following this guide as-is would take on the storage overhead without
knowing there's a way to avoid it.

What's added

A short note right after the copy_to example that:

  • Clarifies that name and plot are still indexed individually in
    this example, in addition to name_and_plot
  • Explains how to avoid that overhead ("index": false on the source
    fields, if they don't need to be searched individually)
  • Cross-links to size-shards.md for more detail on copy_to as a
    mapping-overhead reduction technique

Testing

  • Docs build passes
  • New note renders correctly between the copy_to example and
    "Pre-index data"

The 'Search as few fields as possible' section shows copy_to purely as
a search-speed win, with no mention that the source fields (name, plot)
remain separately indexed alongside the new combined field - meaning
the example as written adds roughly a third field's worth of index
storage rather than saving any.

size-shards.md already frames copy_to as a way to reduce per-field
mapping overhead, which only holds if indexing is disabled on the
source fields once they're only needed via the combined field. This
wasn't connected to the search-speed.md example, so readers following
this guide as-is would not get that storage benefit and might be
surprised by the added overhead.

Added a note plus a cross-link to size-shards.md so readers see both
the cost and the way to avoid it.
@ash9146
ash9146 requested a review from a team as a code owner August 5, 2026 02:19

@georgewallace georgewallace left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually have a directive for notes so they render as such on the page, also made some suggestions to the verbiage.

Comment thread deploy-manage/production-guidance/optimize-performance/search-speed.md Outdated
ash9146 and others added 2 commits August 5, 2026 22:38
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Elastic Docs AI PR menu

Check the box to run an AI review for this pull request.

  • Review docs changes (docs-review). Status: not started.

Powered by GitHub Agentic Workflows and docs-actions. For more information, reach out to the docs team.

Updated note formatting and clarified indexing advice.

@georgewallace georgewallace left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for making the improvements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants