{"action":"opened","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch-rails/issues/630","repository_url":"https://api.github.com/repos/elastic/elasticsearch-rails","labels_url":"https://api.github.com/repos/elastic/elasticsearch-rails/issues/630/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch-rails/issues/630/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch-rails/issues/630/events","html_url":"https://github.com/elastic/elasticsearch-rails/issues/630","id":181470406,"number":630,"title":"Most recent record form Elasticsearch Rails based on Multiple indices","user":{"login":"g13ydson","id":1000342,"avatar_url":"https://avatars.githubusercontent.com/u/1000342?v=3","gravatar_id":"","url":"https://api.github.com/users/g13ydson","html_url":"https://github.com/g13ydson","followers_url":"https://api.github.com/users/g13ydson/followers","following_url":"https://api.github.com/users/g13ydson/following{/other_user}","gists_url":"https://api.github.com/users/g13ydson/gists{/gist_id}","starred_url":"https://api.github.com/users/g13ydson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/g13ydson/subscriptions","organizations_url":"https://api.github.com/users/g13ydson/orgs","repos_url":"https://api.github.com/users/g13ydson/repos","events_url":"https://api.github.com/users/g13ydson/events{/privacy}","received_events_url":"https://api.github.com/users/g13ydson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-06T16:56:53Z","updated_at":"2016-10-06T16:56:53Z","closed_at":null,"body":"I'm starting to use ElasticSearch in my application and wanted a way to bring the models rent and share most recent.\r\n\r\nI tried the following:\r\n\r\n```\r\n@response = Elasticsearch::Model.search query:     {\r\n  \"indices\": {\r\n    \"indices\": [\r\n      \"shares\",\r\n      \"rents\"\r\n    ],\r\n    \"sort\": {\r\n       \"create_at\": {\r\n          \"order\": \"desc\"\r\n       }\r\n    },\r\n    \"query\": {\r\n      \"multi_match\": {\r\n        \"query\": \"Apartament\",\r\n        \"fields\": [ \"tipe\"]\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\nBut I do not know how to bring the most recent based on create_at field."}}
{"actor":{"display_login":"g13ydson"}}