Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] Improve tuning for speed advice #33315

Merged
merged 1 commit into from
Sep 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions docs/reference/how-to/search-speed.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,15 @@ GET index/_search
// TEST[continued]

[float]
=== Mappings
=== Consider mapping identifiers as `keyword`

The fact that some data is numeric does not mean it should always be mapped as a
<<number,numeric field>>. Typically, fields storing identifiers such as an `ISBN`
or any number identifying a record from another database, might benefit from
being mapped as <<keyword,`keyword`>> rather than `integer` or `long`.
<<number,numeric field>>. The way that Elasticsearch indexes numbers optimizes
for `range` queries while `keyword` fields are better at `term` queries. Typically,
fields storing identifiers such as an `ISBN` or any number identifying a record
from another database are rarely used in `range` queries or aggregations. This is
why they might benefit from being mapped as <<keyword,`keyword`>> rather than as
`integer` or `long`.

[float]
=== Avoid scripts
Expand Down Expand Up @@ -349,15 +352,6 @@ WARNING: Loading data into the filesystem cache eagerly on too many indices or
too many files will make search _slower_ if the filesystem cache is not large
enough to hold all the data. Use with caution.

[float]
=== Map identifiers as `keyword`

When you have numeric identifiers in your documents, it is tempting to map them
as numbers, which is consistent with their json type. However, the way that
Elasticsearch indexes numbers optimizes for `range` queries while `keyword`
fields are better at `term` queries. Since identifiers are never used in `range`
queries, they should be mapped as a `keyword`.

[float]
=== Use index sorting to speed up conjunctions

Expand Down