Beta: Fielddata


So my testing box locked up...had to hard power it down. Now I am seeing this:

[2016-10-28T19:56:19,264][DEBUG][o.e.a.s.TransportSearchAction] [scanner] All shards failed for phase: [query]
org.elasticsearch.transport.RemoteTransportException: [scanner][][indices:data/read/search[phase/query]]
Caused by: java.lang.IllegalArgumentException: Fielddata is disabled on text fields by default. Set fielddata=true on [service] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory.
	at org.elasticsearch.index.mapper.TextFieldMapper$TextFieldType.fielddataBuilder( ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
	at org.elasticsearch.index.fielddata.IndexFieldDataService.getForField( ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
	at ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
	at ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
	at ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
	at<init>( ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
	at<init>( ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
	at ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
	at ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
	at ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
	at ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
	at$ ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
	at ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
	at ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
	at ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
	at ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
	at$registerRequestHandler$6( ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
	at org.elasticsearch.transport.TransportRequestHandler.messageReceived( ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
	at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived( ~[elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
	at org.elasticsearch.transport.TransportService$6.doRun( [elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun( [elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
	at [elasticsearch-5.0.0-beta1.jar:5.0.0-beta1]
	at java.util.concurrent.ThreadPoolExecutor.runWorker( [?:1.8.0_111]
	at java.util.concurrent.ThreadPoolExecutor$ [?:1.8.0_111]
	at [?:1.8.0_111]

also now almost all of my fields have a fieldname.keyword as well. Can someone shed some light on what this is? Thank you.

(Martijn Van Groningen) #2

Elasticsearch 5.x will automatically upgrade string fields to either text or keyword field type. The string field has been removed since 5.0. The text field requires field data for any aggregation like operation. So you will need to enabled that. It is disabled by default, because field data on text field can require a lot of memory. So you have to be cautious when enabling field data on text fields.

I don't think the error has anything to do with the fact that your restarted ES. This error just happens when searches are being executed that have aggregations on a text field.


Thanks Martijn. Wow did I hose explaining this....sorry about that :frowning: Ok so first off, after removing all indexes, mappings, and templates...basically restarting, here's what the mappings look like:

there's no .keywoard, and, per my mapping, all stings are set to not analyzed. After doing a system upgrade (Ubuntu 16.04 server) (last log here):

Start-Date: 2016-10-28  08:48:14
Commandline: apt-get dist-upgrade
Requested-By: (1000)
Upgrade: libc6-dev:amd64 (2.23-0ubuntu3, 2.23-0ubuntu4), libmysqlclient-dev:amd64 (5.7.15-0ubuntu0.16.04.1, 5.7.16-0ubuntu0.16.04.1), libc6:amd64 (2.23-0ubuntu3, 2.23-0ubuntu4), locales:amd64 (2.23-0ubuntu3, 2.23-0ubuntu4), language-pack-en:amd64 (1:16.04+20160627, 1:16.04+20161009), libapparmor1:amd64 (2.10.95-0ubuntu2.2, 2.10.95-0ubuntu2.5), libapparmor-perl:amd64 (2.10.95-0ubuntu2.2, 2.10.95-0ubuntu2.5), python3-distupgrade:amd64 (1:16.04.16, 1:16.04.17), libc-bin:amd64 (2.23-0ubuntu3, 2.23-0ubuntu4), ubuntu-release-upgrader-core:amd64 (1:16.04.16, 1:16.04.17), mysql-common:amd64 (5.7.15-0ubuntu0.16.04.1, 5.7.16-0ubuntu0.16.04.1), libmysqlclient20:amd64 (5.7.15-0ubuntu0.16.04.1, 5.7.16-0ubuntu0.16.04.1), libc-dev-bin:amd64 (2.23-0ubuntu3, 2.23-0ubuntu4), multiarch-support:amd64 (2.23-0ubuntu3, 2.23-0ubuntu4), apparmor:amd64 (2.10.95-0ubuntu2.2, 2.10.95-0ubuntu2.5)

the machine had an issue...what the issue was I don't know, but I got no response from it during this upgrade. Once getting physical access and restarting is when I saw that all fields were checkmarked analyzed, and each string had a secondary, for example, curve had curve.keyword. So if that's expected behavior, why don't I see them now? And how do I enable the text field item? Thank you....hope that makes it clearer.


Ok so I'm doing more reading here: Field Data but I'm not sure exactly what I need to do, if anything, on my end. I don't see this right now...but there are several visualizations that rely on a field called "services". When this change happened I had to switch them all to "services.keyword". Thanks again.


Circling back on this....after running 2 days the ".keyword" popped up again, so this looks like normal behavior. This go round however my string fields remained non-analyzed. I did have to change all my visualizations to point to the .keyword fields afterwards. Is there a way to force this on install or upgrade instead of having it happening randomly? Thank you.

(system) #6