{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/scout/issues/70","repository_url":"https://api.github.com/repos/laravel/scout","labels_url":"https://api.github.com/repos/laravel/scout/issues/70/labels{/name}","comments_url":"https://api.github.com/repos/laravel/scout/issues/70/comments","events_url":"https://api.github.com/repos/laravel/scout/issues/70/events","html_url":"https://github.com/laravel/scout/pull/70","id":176679215,"number":70,"title":"Remove elasticsearch_index, use $model->searchableAs() instead","user":{"login":"brino","id":986822,"avatar_url":"https://avatars.githubusercontent.com/u/986822?v=3","gravatar_id":"","url":"https://api.github.com/users/brino","html_url":"https://github.com/brino","followers_url":"https://api.github.com/users/brino/followers","following_url":"https://api.github.com/users/brino/following{/other_user}","gists_url":"https://api.github.com/users/brino/gists{/gist_id}","starred_url":"https://api.github.com/users/brino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brino/subscriptions","organizations_url":"https://api.github.com/users/brino/orgs","repos_url":"https://api.github.com/users/brino/repos","events_url":"https://api.github.com/users/brino/events{/privacy}","received_events_url":"https://api.github.com/users/brino/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-09-13T15:52:25Z","updated_at":"2016-09-19T14:48:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/laravel/scout/pulls/70","html_url":"https://github.com/laravel/scout/pull/70","diff_url":"https://github.com/laravel/scout/pull/70.diff","patch_url":"https://github.com/laravel/scout/pull/70.patch"},"body":"Removed elasticsearch_index, Elasticsearch [officially suggests] (https://www.elastic.co/blog/index-vs-type) using one single Type per Index unless you have a very good reason not to. This is because fields must be consistent between types. Therefor, you could never have 2 fields with the same name but different field types within two different models that use the Searchable trait. In that case elastic would silently fail to index the document with the NON-matching field type.\r\n\r\nSo, it makes more sense to use `$model->searchableAs()` as the \"index\" name, and then basically any string as the \"type\" name."},"comment":{"url":"https://api.github.com/repos/laravel/scout/issues/comments/248014888","html_url":"https://github.com/laravel/scout/pull/70#issuecomment-248014888","issue_url":"https://api.github.com/repos/laravel/scout/issues/70","id":248014888,"user":{"login":"brino","id":986822,"avatar_url":"https://avatars.githubusercontent.com/u/986822?v=3","gravatar_id":"","url":"https://api.github.com/users/brino","html_url":"https://github.com/brino","followers_url":"https://api.github.com/users/brino/followers","following_url":"https://api.github.com/users/brino/following{/other_user}","gists_url":"https://api.github.com/users/brino/gists{/gist_id}","starred_url":"https://api.github.com/users/brino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brino/subscriptions","organizations_url":"https://api.github.com/users/brino/orgs","repos_url":"https://api.github.com/users/brino/repos","events_url":"https://api.github.com/users/brino/events{/privacy}","received_events_url":"https://api.github.com/users/brino/received_events","type":"User","site_admin":false},"created_at":"2016-09-19T14:48:06Z","updated_at":"2016-09-19T14:48:06Z","body":"@hernandev is dead on... that's actually the same article I linked in the first comment.\r\n\r\nHere is the important part: \r\n\r\n> **Which one should I use?**\r\n> I will try to summarize the questions you should ask yourself to make a decision:\r\n>\r\n> - Are you using parent/child? If yes this can only be done with two types in the same index.\r\n> - Do your documents have similar mappings? If no, use different indices.\r\n> - If you have many documents for each type, then the overhead of Lucene indices will be easily amortized so you can safely use indices, with fewer shards than the default of 5 if necessary.\r\n> - Otherwise you can consider putting documents in different types of the same index. Or even in the same type.\r\n\r\nSo basically what they are saying is... use different Indices, unless you have a specific use case NOT to. And, while @mtdavidson is correct about the Parent/child mappings, it probably isn't a use case Scout would handle out of the box."}}
{"actor":{"display_login":"brino"}}