"reason":"Fielddata is disabled on text fields by default. Set fielddata=true on [dataFlag] in order

{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Fielddata is disabled on text fields by default. Set fielddata=true on [dataFlag] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead."},{"type":"query_shard_exception","reason":"No mapping found for [dataFlag] in order to sort on","index_uuid":"21KE44G_Qhaybnjiga6Inw","index":"standard"},{"type":"query_shard_exception","reason":"No mapping found for [dataFlag] in order to sort on","index_uuid":"pybKDZDoRw2fWY4XDE-1Eg","index":"standard_data_item"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"checkrule","node":"MPMk7JLeSD6RpR2mfQj3Ew","reason":{"type":"illegal_argument_exception","reason":"Fielddata is disabled on text fields by default. Set fielddata=true on [dataFlag] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead."}},{"shard":0,"index":"standard","node":"MPMk7JLeSD6RpR2mfQj3Ew","reason":{"type":"query_shard_exception","reason":"No mapping found for [dataFlag] in order to sort on","index_uuid":"21KE44G_Qhaybnjiga6Inw","index":"standard"}},{"shard":0,"index":"standard_data_item","node":"MPMk7JLeSD6RpR2mfQj3Ew","reason":{"type":"query_shard_exception","reason":"No mapping found for [dataFlag] in order to sort on","index_uuid":"pybKDZDoRw2fWY4XDE-1Eg","index":"standard_data_item"}}]},"status":400}

上述错误是说standard和中没有dataFlag的映射关系导致,先看有哪些索引,然后再看索引的映射关系

http://192.168.1.100:9210/_cat/indices

http://192.168.1.100:9210/standard/_mapping

然后发现索引中没有此字段,当然也就没有对应的映射关系,将无字段的索引删除还是报错,使用fieldName.keyword解决

你可能感兴趣的:(ElasticSearch)