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

Add the ability to disallow field data loading #4431

Closed
jpountz opened this issue Dec 12, 2013 · 9 comments
Closed

Add the ability to disallow field data loading #4431

jpountz opened this issue Dec 12, 2013 · 9 comments

Comments

@jpountz
Copy link
Contributor

jpountz commented Dec 12, 2013

Field data can be a black hole for memory (eg. on full-text fields), so it should be possible to disallow field data loading on a per-field basis.

@ghost ghost assigned jpountz Dec 12, 2013
jpountz added a commit to jpountz/elasticsearch that referenced this issue Dec 12, 2013
…ility to disallow field data loading.

This commit changes field data configuration updates so that they are
immediately taken into account for loading new segments. The way it works
is that field data configuration is now cached separately from the field
data cache, meaning that it is now possible to clear the field data
configuration from IndexFieldDataService while the cache will stay around. On
the next time that Elasticsearch will reload field data configuration, it will
check if there is already a cache entry, and reuse it if it exists.

To disable field data loading, all that is required is to change the field
data format to "none" (supported by all field data types) using the update
mapping API. Elasticsearch will then refuse to load field data on any new
segment, but field data which has been loaded on the previous segments will
remain available. So you need to clear the field data cache in order to
reclaim memory (otherwise memory will be reclaimed slower, as segments get
merged).

Close elastic#4430
Close elastic#4431
@s1monw
Copy link
Contributor

s1monw commented Dec 12, 2013

huge +1 to the feature :)

@spinscale
Copy link
Contributor

nice screw-up protection. what about documentation?

@jpountz
Copy link
Contributor Author

jpountz commented Dec 12, 2013

I just added a new commit with documentation. Shame on me for having forgotten it!

jpountz added a commit that referenced this issue Dec 16, 2013
…ility to disallow field data loading.

This commit changes field data configuration updates so that they are
immediately taken into account for loading new segments. The way it works
is that field data configuration is now cached separately from the field
data cache, meaning that it is now possible to clear the field data
configuration from IndexFieldDataService while the cache will stay around. On
the next time that Elasticsearch will reload field data configuration, it will
check if there is already a cache entry, and reuse it if it exists.

To disable field data loading, all that is required is to change the field
data format to "none" (supported by all field data types) using the update
mapping API. Elasticsearch will then refuse to load field data on any new
segment, but field data which has been loaded on the previous segments will
remain available. So you need to clear the field data cache in order to
reclaim memory (otherwise memory will be reclaimed slower, as segments get
merged).

Close #4430
Close #4431
brusic pushed a commit to brusic/elasticsearch that referenced this issue Jan 19, 2014
…ility to disallow field data loading.

This commit changes field data configuration updates so that they are
immediately taken into account for loading new segments. The way it works
is that field data configuration is now cached separately from the field
data cache, meaning that it is now possible to clear the field data
configuration from IndexFieldDataService while the cache will stay around. On
the next time that Elasticsearch will reload field data configuration, it will
check if there is already a cache entry, and reuse it if it exists.

To disable field data loading, all that is required is to change the field
data format to "none" (supported by all field data types) using the update
mapping API. Elasticsearch will then refuse to load field data on any new
segment, but field data which has been loaded on the previous segments will
remain available. So you need to clear the field data cache in order to
reclaim memory (otherwise memory will be reclaimed slower, as segments get
merged).

Close elastic#4430
Close elastic#4431
@CamiloSierraH
Copy link

i think so there is a problem in the documentation wich says that "The disabled format is supported by all field types." it works for string, long but not for nested ! (i use ES 0.9.11)
bug or documentation not updated ?

@jpountz
Copy link
Contributor Author

jpountz commented Feb 20, 2014

There is no field data concept for the nested type so indeed the documentation should rather state that it is supported on all core types. I will fix it soon, thanks!

@jpountz
Copy link
Contributor Author

jpountz commented Feb 20, 2014

@CamiloSierraH to be sure I got you right, what were your expectations when setting the field data format on a nested field?

@CamiloSierraH
Copy link

@jpountz i have some nested that i like disabled, i only use this nested in filters (no facets, no sort) because i have some millions of documents and i need to use the ram only if is necessary!

Thanks

@jpountz
Copy link
Contributor Author

jpountz commented Feb 21, 2014

@CamiloSierraH In that case you should use the disabled format on the fields that are under the nested field, for example:

{
    "type1" : {
        "properties" : {
            "obj1" : {
                "type" : "nested",
                "properties": {
                    "prop1": {
                        "type": "long",
                        "fielddata": {
                             "format": "disabled"
                         }
                    }
                }
            }
        }
    }
}

Note: disabled is used on obj1.prop1, not obj1.

@CamiloSierraH
Copy link

ok thank you @jpountz !! (i hope i can release some memory ram 👍 )

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
…ility to disallow field data loading.

This commit changes field data configuration updates so that they are
immediately taken into account for loading new segments. The way it works
is that field data configuration is now cached separately from the field
data cache, meaning that it is now possible to clear the field data
configuration from IndexFieldDataService while the cache will stay around. On
the next time that Elasticsearch will reload field data configuration, it will
check if there is already a cache entry, and reuse it if it exists.

To disable field data loading, all that is required is to change the field
data format to "none" (supported by all field data types) using the update
mapping API. Elasticsearch will then refuse to load field data on any new
segment, but field data which has been loaded on the previous segments will
remain available. So you need to clear the field data cache in order to
reclaim memory (otherwise memory will be reclaimed slower, as segments get
merged).

Close elastic#4430
Close elastic#4431
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants