{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch-rails/issues/415","labels_url":"https://api.github.com/repos/elastic/elasticsearch-rails/issues/415/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch-rails/issues/415/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch-rails/issues/415/events","html_url":"https://github.com/elastic/elasticsearch-rails/issues/415","id":82861921,"number":415,"title":"providing search_type","user":{"login":"o-r-r","id":12617393,"avatar_url":"https://avatars.githubusercontent.com/u/12617393?v=3","gravatar_id":"","url":"https://api.github.com/users/o-r-r","html_url":"https://github.com/o-r-r","followers_url":"https://api.github.com/users/o-r-r/followers","following_url":"https://api.github.com/users/o-r-r/following{/other_user}","gists_url":"https://api.github.com/users/o-r-r/gists{/gist_id}","starred_url":"https://api.github.com/users/o-r-r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/o-r-r/subscriptions","organizations_url":"https://api.github.com/users/o-r-r/orgs","repos_url":"https://api.github.com/users/o-r-r/repos","events_url":"https://api.github.com/users/o-r-r/events{/privacy}","received_events_url":"https://api.github.com/users/o-r-r/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-30T17:03:08Z","updated_at":"2015-08-25T08:33:11Z","closed_at":"2015-08-25T08:33:11Z","body":"Hi,\r\nFrom the docs for [elasticsearch-model searching] (http://www.rubydoc.info/gems/elasticsearch-model/#Searching) it's hard to understand how to supply options like search_count. for example if I try the following call:\r\n```ruby\r\nres = MyModel.search  search_type: 'count' , query:     query, aggs: aggs\r\n```\r\nwhere query, and aggs are valid query and aggs object, when trying to access res.response I receive the following error:\r\n\r\n>nested: SearchParseException[[articles_events][4]: from[-1],size[-1]: Parse Failure [No parser for element [search_type]]]; }]\",\"status\":400}\r\n\r\n\r\nremoving search_type: 'count'  removes the error as well.\r\n\r\nIs there an example of providing the options arg?\r\n\r\nThanks\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch-rails/issues/comments/134523292","html_url":"https://github.com/elastic/elasticsearch-rails/issues/415#issuecomment-134523292","issue_url":"https://api.github.com/repos/elastic/elasticsearch-rails/issues/415","id":134523292,"user":{"login":"o-r-r","id":12617393,"avatar_url":"https://avatars.githubusercontent.com/u/12617393?v=3","gravatar_id":"","url":"https://api.github.com/users/o-r-r","html_url":"https://github.com/o-r-r","followers_url":"https://api.github.com/users/o-r-r/followers","following_url":"https://api.github.com/users/o-r-r/following{/other_user}","gists_url":"https://api.github.com/users/o-r-r/gists{/gist_id}","starred_url":"https://api.github.com/users/o-r-r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/o-r-r/subscriptions","organizations_url":"https://api.github.com/users/o-r-r/orgs","repos_url":"https://api.github.com/users/o-r-r/repos","events_url":"https://api.github.com/users/o-r-r/events{/privacy}","received_events_url":"https://api.github.com/users/o-r-r/received_events","type":"User","site_admin":false},"created_at":"2015-08-25T08:33:10Z","updated_at":"2015-08-25T08:33:10Z","body":"Thanks.\r\nGot it to work eventually by something similar:\r\n```MyModel.search  { query:     query, aggs: aggs },  { :timeout => 3 , :search_type => 'count'}```"}}