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

[7.14] Mention match_only_text in disk usage docs (#76416) #76497

Merged
merged 1 commit into from
Aug 13, 2021
Merged
Show file tree
Hide file tree
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
73 changes: 9 additions & 64 deletions docs/reference/how-to/disk-usage.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
[discrete]
=== Disable the features you do not need

By default Elasticsearch indexes and adds doc values to most fields so that they
can be searched and aggregated out of the box. For instance if you have a numeric
By default, {es} indexes and adds doc values to most fields so that they
can be searched and aggregated out of the box. For instance, if you have a numeric
field called `foo` that you need to run histograms on but that you never need to
filter on, you can safely disable indexing on this field in your
<<mappings,mappings>>:

[source,console]
--------------------------------------------------
----
PUT index
{
"mappings": {
Expand All @@ -23,68 +23,13 @@ PUT index
}
}
}
--------------------------------------------------

<<text,`text`>> fields store normalization factors in the index in order to be
able to score documents. If you only need matching capabilities on a `text`
field but do not care about the produced scores, you can configure Elasticsearch
to not write norms to the index:

[source,console]
--------------------------------------------------
PUT index
{
"mappings": {
"properties": {
"foo": {
"type": "text",
"norms": false
}
}
}
}
--------------------------------------------------

<<text,`text`>> fields also store frequencies and positions in the index by
default. Frequencies are used to compute scores and positions are used to run
phrase queries. If you do not need to run phrase queries, you can tell
Elasticsearch to not index positions:
----

[source,console]
--------------------------------------------------
PUT index
{
"mappings": {
"properties": {
"foo": {
"type": "text",
"index_options": "freqs"
}
}
}
}
--------------------------------------------------

Furthermore if you do not care about scoring either, you can configure
Elasticsearch to just index matching documents for every term. You will
still be able to search on this field, but phrase queries will raise errors
and scoring will assume that terms appear only once in every document.

[source,console]
--------------------------------------------------
PUT index
{
"mappings": {
"properties": {
"foo": {
"type": "text",
"norms": false,
"index_options": "freqs"
}
}
}
}
--------------------------------------------------
<<text,`text`>> fields store normalization factors in the index to facilitate
document scoring. If you only need matching capabilities on a `text`
field but do not care about the produced scores, you can use the
<<match-only-text-field-type,`match_only_text`>> type instead. This field type
saves significant space by dropping scoring and positional information.

[discrete]
[[default-dynamic-string-mapping]]
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/mapping/types/match-only-text.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Analysis is not configurable: text is always analyzed with the
<<text-field-type,`text`>> field type if you absolutely need span queries.

Other than that, `match_only_text` supports the same queries as `text`. And
like `text`, it does not support sorting and has only limited support for aggretations.
like `text`, it does not support sorting and has only limited support for aggregations.

[source,console]
--------------------------------
----
PUT logs
{
"mappings": {
Expand All @@ -37,7 +37,7 @@ PUT logs
}
}
}
--------------------------------
----

[discrete]
[[match-only-text-params]]
Expand Down