{"action":"created","issue":{"url":"https://api.github.com/repos/Kdyby/ElasticSearch/issues/9","labels_url":"https://api.github.com/repos/Kdyby/ElasticSearch/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/Kdyby/ElasticSearch/issues/9/comments","events_url":"https://api.github.com/repos/Kdyby/ElasticSearch/issues/9/events","html_url":"https://github.com/Kdyby/ElasticSearch/pull/9","id":94477004,"number":9,"title":"Fixed multi-request output in panel","user":{"login":"Andrewsville","id":506715,"avatar_url":"https://avatars.githubusercontent.com/u/506715?v=3","gravatar_id":"","url":"https://api.github.com/users/Andrewsville","html_url":"https://github.com/Andrewsville","followers_url":"https://api.github.com/users/Andrewsville/followers","following_url":"https://api.github.com/users/Andrewsville/following{/other_user}","gists_url":"https://api.github.com/users/Andrewsville/gists{/gist_id}","starred_url":"https://api.github.com/users/Andrewsville/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Andrewsville/subscriptions","organizations_url":"https://api.github.com/users/Andrewsville/orgs","repos_url":"https://api.github.com/users/Andrewsville/repos","events_url":"https://api.github.com/users/Andrewsville/events{/privacy}","received_events_url":"https://api.github.com/users/Andrewsville/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-07-11T14:09:50Z","updated_at":"2015-07-13T14:11:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Kdyby/ElasticSearch/pulls/9","html_url":"https://github.com/Kdyby/ElasticSearch/pull/9","diff_url":"https://github.com/Kdyby/ElasticSearch/pull/9.diff","patch_url":"https://github.com/Kdyby/ElasticSearch/pull/9.patch"},"body":"There is a problem with request data output in panel when doing a multi-request, for exampe a [multi-search request](http://elastica.io/api/classes/Elastica.Multi.Search.html). The problem is that the request is a string that contains several lines delimited by \\n where each line is a valid JSON, but the whole string obviously isn't ([ES docs with examples](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html)). The current state is that the data string is not possible to decode as JSON and panel displays it as a string (probably truncated) which makes it kind of useless.\r\n\r\nI wasn't able to find a better solution that the one suggested with this PR - when the request definition is a string and there was a problem decoding it as a JSON, let's try to explode it a decode individual lines. If that fails too, return the original request string like before."},"comment":{"url":"https://api.github.com/repos/Kdyby/ElasticSearch/issues/comments/120940947","html_url":"https://github.com/Kdyby/ElasticSearch/pull/9#issuecomment-120940947","issue_url":"https://api.github.com/repos/Kdyby/ElasticSearch/issues/9","id":120940947,"user":{"login":"Andrewsville","id":506715,"avatar_url":"https://avatars.githubusercontent.com/u/506715?v=3","gravatar_id":"","url":"https://api.github.com/users/Andrewsville","html_url":"https://github.com/Andrewsville","followers_url":"https://api.github.com/users/Andrewsville/followers","following_url":"https://api.github.com/users/Andrewsville/following{/other_user}","gists_url":"https://api.github.com/users/Andrewsville/gists{/gist_id}","starred_url":"https://api.github.com/users/Andrewsville/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Andrewsville/subscriptions","organizations_url":"https://api.github.com/users/Andrewsville/orgs","repos_url":"https://api.github.com/users/Andrewsville/repos","events_url":"https://api.github.com/users/Andrewsville/events{/privacy}","received_events_url":"https://api.github.com/users/Andrewsville/received_events","type":"User","site_admin":false},"created_at":"2015-07-13T14:11:53Z","updated_at":"2015-07-13T14:11:53Z","body":"OK, I've played with the panel and it gets quite messy (turn off whitespace comparison for more readability) :)\r\n\r\nBasically the header (request, search type) is the same. Then it checks if response contains the ```responses``` key and decides if it is a multiresponse or not. If not, everything looks like now. If so, every response gets its own table. Because every subrequest can return an error, it has to be displayed in the appropriate table.\r\n\r\n![shot_150713_161136](https://cloud.githubusercontent.com/assets/506715/8651546/ddd826f8-2979-11e5-9d55-01692094ff1d.png)\r\n"}}