{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/31287","repository_url":"https://api.github.com/repos/elastic/elasticsearch","labels_url":"https://api.github.com/repos/elastic/elasticsearch/issues/31287/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch/issues/31287/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch/issues/31287/events","html_url":"https://github.com/elastic/elasticsearch/pull/31287","id":331816429,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk0NDUzNjg0","number":31287,"title":"Add support for field aliases in index mappings.","user":{"login":"jtibshirani","id":7461306,"node_id":"MDQ6VXNlcjc0NjEzMDY=","avatar_url":"https://avatars3.githubusercontent.com/u/7461306?v=4","gravatar_id":"","url":"https://api.github.com/users/jtibshirani","html_url":"https://github.com/jtibshirani","followers_url":"https://api.github.com/users/jtibshirani/followers","following_url":"https://api.github.com/users/jtibshirani/following{/other_user}","gists_url":"https://api.github.com/users/jtibshirani/gists{/gist_id}","starred_url":"https://api.github.com/users/jtibshirani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtibshirani/subscriptions","organizations_url":"https://api.github.com/users/jtibshirani/orgs","repos_url":"https://api.github.com/users/jtibshirani/repos","events_url":"https://api.github.com/users/jtibshirani/events{/privacy}","received_events_url":"https://api.github.com/users/jtibshirani/received_events","type":"User","site_admin":false},"labels":[{"id":141145460,"node_id":"MDU6TGFiZWwxNDExNDU0NjA=","url":"https://api.github.com/repos/elastic/elasticsearch/labels/:Search/Mapping","name":":Search/Mapping","color":"0e8a16","default":false},{"id":130371191,"node_id":"MDU6TGFiZWwxMzAzNzExOTE=","url":"https://api.github.com/repos/elastic/elasticsearch/labels/WIP","name":"WIP","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-13T02:14:38Z","updated_at":"2018-06-13T19:46:32Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/elastic/elasticsearch/pulls/31287","html_url":"https://github.com/elastic/elasticsearch/pull/31287","diff_url":"https://github.com/elastic/elasticsearch/pull/31287.diff","patch_url":"https://github.com/elastic/elasticsearch/pull/31287.patch"},"body":"Addresses https://github.com/elastic/elasticsearch/issues/23714.\r\n\r\nGeneral approach: \r\n- Create a new top-level `Mapper` type called `FieldAliasMapper`. Note that this new type does not inherit from `FieldMapper`.\r\n- Make sure to keep track of aliases in `MapperService` so that when field aliases are supplied to `MapperService#fullName`, the correct concrete field type is returned. The bulk of this logic resides in `FieldTypeLookup`.\r\n\r\nCurrent functionality:\r\n- Almost all parts of the search request support field aliases. In particular, aliases can be used in queries, aggregations, and sort fields, as well as when requesting `docvalue_fields`, suggestions, and highlights.\r\n- Field aliases can be used in the capabilities API.\r\n- If field names are provided as wildcards, field aliases will be matched in addition to concrete fields.\r\n- A concrete field can be added in one mappings update, and an alias added in a separate update.\r\n- If a concrete field type is updated, any aliases it has will always refer to the latest version.\r\n- Attempts to write to a field alias will cause document parsing to fail.\r\n\r\nStill TODO:\r\n- [ ] Perform validation on the field alias mapping. In particular, it should not reference an object field or another alias field. In addition, the alias and its concrete field should have the same nested scope.\r\n- [ ] Ensure that field aliases can be used when loading `stored_fields`.\r\n- [ ] Make sure field aliases can be accessed from a script (I think this should work already, but it needs tests).\r\n- [ ] Add documentation.\r\n- [ ] Likely add more tests around different query types and wildcard field matching.\r\n- [ ] Consider adding support for aliases in other relevant APIs, like`_termvectors`.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch/issues/comments/397062261","html_url":"https://github.com/elastic/elasticsearch/pull/31287#issuecomment-397062261","issue_url":"https://api.github.com/repos/elastic/elasticsearch/issues/31287","id":397062261,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzA2MjI2MQ==","user":{"login":"jtibshirani","id":7461306,"node_id":"MDQ6VXNlcjc0NjEzMDY=","avatar_url":"https://avatars3.githubusercontent.com/u/7461306?v=4","gravatar_id":"","url":"https://api.github.com/users/jtibshirani","html_url":"https://github.com/jtibshirani","followers_url":"https://api.github.com/users/jtibshirani/followers","following_url":"https://api.github.com/users/jtibshirani/following{/other_user}","gists_url":"https://api.github.com/users/jtibshirani/gists{/gist_id}","starred_url":"https://api.github.com/users/jtibshirani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtibshirani/subscriptions","organizations_url":"https://api.github.com/users/jtibshirani/orgs","repos_url":"https://api.github.com/users/jtibshirani/repos","events_url":"https://api.github.com/users/jtibshirani/events{/privacy}","received_events_url":"https://api.github.com/users/jtibshirani/received_events","type":"User","site_admin":false},"created_at":"2018-06-13T19:46:32Z","updated_at":"2018-06-13T19:46:32Z","author_association":"MEMBER","body":"test this please"}}
{"actor":{"display_login":"jtibshirani"}}