{"action":"closed","issue":{"url":"https://api.github.com/repos/10up/ElasticPress/issues/643","repository_url":"https://api.github.com/repos/10up/ElasticPress","labels_url":"https://api.github.com/repos/10up/ElasticPress/issues/643/labels{/name}","comments_url":"https://api.github.com/repos/10up/ElasticPress/issues/643/comments","events_url":"https://api.github.com/repos/10up/ElasticPress/issues/643/events","html_url":"https://github.com/10up/ElasticPress/issues/643","id":192066266,"number":643,"title":"\"Fielddata is disabled on text fields by default.\" Admin Feature","user":{"login":"bcumber","id":5377299,"avatar_url":"https://avatars1.githubusercontent.com/u/5377299?v=3","gravatar_id":"","url":"https://api.github.com/users/bcumber","html_url":"https://github.com/bcumber","followers_url":"https://api.github.com/users/bcumber/followers","following_url":"https://api.github.com/users/bcumber/following{/other_user}","gists_url":"https://api.github.com/users/bcumber/gists{/gist_id}","starred_url":"https://api.github.com/users/bcumber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcumber/subscriptions","organizations_url":"https://api.github.com/users/bcumber/orgs","repos_url":"https://api.github.com/users/bcumber/repos","events_url":"https://api.github.com/users/bcumber/events{/privacy}","received_events_url":"https://api.github.com/users/bcumber/received_events","type":"User","site_admin":false},"labels":[{"id":105790605,"url":"https://api.github.com/repos/10up/ElasticPress/labels/wontfix","name":"wontfix","color":"f0f0f0","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2016-11-28T17:26:01Z","updated_at":"2017-07-05T17:31:15Z","closed_at":"2017-07-05T17:31:15Z","body":"I get the following exception from Elasticpress when I load the \"Pages\" in the admin screen:\r\n\r\n```json\r\n{\r\n    \"error\": {\r\n        \"root_cause\": [\r\n            {\r\n                \"type\": \"illegal_argument_exception\",\r\n                \"reason\": \"Fielddata is disabled on text fields by default. Set fielddata=true on [post_title.sortable] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory.\"\r\n            }\r\n        ],\r\n        \"type\": \"search_phase_execution_exception\",\r\n        \"reason\": \"all shards failed\",\r\n        \"phase\": \"query\",\r\n        \"grouped\": true,\r\n        \"failed_shards\": [\r\n            {\r\n                \"shard\": 0,\r\n                \"index\": \"devboxbennet-1\",\r\n                \"node\": \"VbXshdquSwqnaeSD02K7vQ\",\r\n                \"reason\": {\r\n                    \"type\": \"illegal_argument_exception\",\r\n                    \"reason\": \"Fielddata is disabled on text fields by default. Set fielddata=true on [post_title.sortable] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory.\"\r\n                }\r\n            }\r\n        ],\r\n        \"caused_by\": {\r\n            \"type\": \"illegal_argument_exception\",\r\n            \"reason\": \"Fielddata is disabled on text fields by default. Set fielddata=true on [post_title.sortable] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory.\"\r\n        }\r\n    },\r\n    \"status\": 400\r\n}\r\n```\r\n\r\nIf I understand this error correctly (and I'm new to Elasticsearch, Wordpress, and ElasticPress so I could very well be misunderstanding) version 5.x of Elasticsearch does not index text fields for sorting by default. (This does seem to differ from previous versions [5.x](https://www.elastic.co/guide/en/elasticsearch/reference/current/fielddata.html#_fielddata_is_disabled_on_literal_text_literal_fields_by_default) vs [2.4](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/fielddata.html))\r\n\r\nThe 5.x documentation provides a way to enable fielddata for text fields. I tried to do this:\r\n```json\r\nPUT devboxbennet-1/_mapping/post\r\n{\r\n  \"properties\": {\r\n    \"post_title\": { \r\n      \"type\":     \"text\",\r\n      \"fields\": {\r\n        \"post_title\": {\r\n          \"type\": \"text\",\r\n          \"analyzer\": \"standard\"\r\n        },\r\n        \"raw\": {\r\n          \"type\": \"keyword\"\r\n        },\r\n        \"sortable\": {\r\n          \"type\": \"text\",\r\n          \"analyzer\": \"ewp_lowercase\",\r\n          \"fielddata\": true\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nWith this setting active, I don't see any errors on the elasticsearch side of things, but Wordpress errors out with a `PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /var/www/html/wp-includes/kses.php on line 1430`. I would assume this is a separate error, on my side of things, but its worth mentioning. Either way, I can't seem to get the admin feature to work.\r\n\r\nSo my first question is: how can I get the admin feature to work by changing elasticsearch/wordpress settings? And my second question is: Is this how ElasticPress should be doing things?"}}
{"actor":{"display_login":"allan23"}}