{"action":"created","comment":{"url":"https://api.github.com/repos/2600hz/kazoo/pulls/comments/41926417","id":41926417,"diff_hunk":"@@ -125,6 +164,86 @@ validate_search(Context, Type, Query) ->\n             Context1\n     end.\n \n+validate_search(Context, _Type, _Query, 'undefined') ->\n+    cb_context:add_validation_error(\n+      <<\"v\">>\n+      ,<<\"required\">>\n+      ,wh_json:from_list([{<<\"message\">>, <<\"Search needs a value to search with\">>}])\n+      ,Context\n+     );\n+validate_search(Context, Type, Query, <<_/binary>> = Value) ->\n+    search(Context, Type, Query, Value);\n+validate_search(Context, Type, Query, Value) ->\n+    case wh_util:is_true(Value) of\n+        'true' -> validate_search(Context, Type, Query, <<>>);\n+        'false' -> validate_search(Context, Type, Query, 'undefined')\n+    end.\n+\n+%%--------------------------------------------------------------------\n+%% @private\n+%% @doc\n+%% @end\n+%%--------------------------------------------------------------------\n+-spec validate_multi(cb_context:context(), ne_binary()) -> cb_context:context().\n+-spec validate_multi(cb_context:context(), ne_binary(), wh_proplist()) -> cb_context:context().\n+validate_multi(Context, 'undefined') ->\n+    cb_context:add_validation_error(\n+        <<\"t\">>\n+        ,<<\"required\">>\n+        ,wh_json:from_list([{<<\"message\">>, <<\"Search needs a document type to search on\">>}])\n+        ,Context\n+    );\n+validate_multi(Context, Type) ->\n+    QS = cb_context:query_string(Context),\n+    case wh_json:to_proplist(wh_json:delete_key(<<\"t\">>, QS)) of\n+        [_|_]=Props -> validate_multi(Context, Type, Props);\n+        _Other ->\n+            cb_context:add_validation_error(\n+                <<\"multi\">>\n+                ,<<\"required\">>\n+                ,wh_json:from_list([{<<\"message\">>, <<\"Multi Search needs something to search\">>}])\n+                ,Context\n+            )\n+    end.\n+\n+validate_multi(Context, Type, Props) ->\n+    QueryOptions = query_options(cb_context:account_db(Context)),\n+    IsValid =\n+        lists:foldl(\n+            fun({Query, _}, Acc) ->\n+                validate_multi_foldl(Query, QueryOptions, Acc)","path":"applications/crossbar/src/modules/cb_search.erl","position":163,"original_position":163,"commit_id":"6b2327c3174955d8b4038b13ffa210b18ca7fc0a","original_commit_id":"6b2327c3174955d8b4038b13ffa210b18ca7fc0a","user":{"login":"macpie","id":778101,"avatar_url":"https://avatars.githubusercontent.com/u/778101?v=3","gravatar_id":"","url":"https://api.github.com/users/macpie","html_url":"https://github.com/macpie","followers_url":"https://api.github.com/users/macpie/followers","following_url":"https://api.github.com/users/macpie/following{/other_user}","gists_url":"https://api.github.com/users/macpie/gists{/gist_id}","starred_url":"https://api.github.com/users/macpie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macpie/subscriptions","organizations_url":"https://api.github.com/users/macpie/orgs","repos_url":"https://api.github.com/users/macpie/repos","events_url":"https://api.github.com/users/macpie/events{/privacy}","received_events_url":"https://api.github.com/users/macpie/received_events","type":"User","site_admin":false},"body":"ok","created_at":"2015-10-13T21:15:29Z","updated_at":"2015-10-13T21:15:29Z","html_url":"https://github.com/2600hz/kazoo/pull/1358#discussion_r41926417","pull_request_url":"https://api.github.com/repos/2600hz/kazoo/pulls/1358","_links":{"self":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/comments/41926417"},"html":{"href":"https://github.com/2600hz/kazoo/pull/1358#discussion_r41926417"},"pull_request":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/1358"}}},"pull_request":{"url":"https://api.github.com/repos/2600hz/kazoo/pulls/1358","id":47577017,"html_url":"https://github.com/2600hz/kazoo/pull/1358","diff_url":"https://github.com/2600hz/kazoo/pull/1358.diff","patch_url":"https://github.com/2600hz/kazoo/pull/1358.patch","issue_url":"https://api.github.com/repos/2600hz/kazoo/issues/1358","number":1358,"state":"open","locked":false,"title":"KAZOO-4241: Adding multi search","user":{"login":"macpie","id":778101,"avatar_url":"https://avatars.githubusercontent.com/u/778101?v=3","gravatar_id":"","url":"https://api.github.com/users/macpie","html_url":"https://github.com/macpie","followers_url":"https://api.github.com/users/macpie/followers","following_url":"https://api.github.com/users/macpie/following{/other_user}","gists_url":"https://api.github.com/users/macpie/gists{/gist_id}","starred_url":"https://api.github.com/users/macpie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macpie/subscriptions","organizations_url":"https://api.github.com/users/macpie/orgs","repos_url":"https://api.github.com/users/macpie/repos","events_url":"https://api.github.com/users/macpie/events{/privacy}","received_events_url":"https://api.github.com/users/macpie/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-13T19:26:47Z","updated_at":"2015-10-13T21:15:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b6e03fec77be48e411f8d83a3bf7edf105ad2f90","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/2600hz/kazoo/pulls/1358/commits","review_comments_url":"https://api.github.com/repos/2600hz/kazoo/pulls/1358/comments","review_comment_url":"https://api.github.com/repos/2600hz/kazoo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/2600hz/kazoo/issues/1358/comments","statuses_url":"https://api.github.com/repos/2600hz/kazoo/statuses/6b2327c3174955d8b4038b13ffa210b18ca7fc0a","head":{"label":"2600hz:KAZOO-4241","ref":"KAZOO-4241","sha":"6b2327c3174955d8b4038b13ffa210b18ca7fc0a","user":{"login":"2600hz","id":408801,"avatar_url":"https://avatars.githubusercontent.com/u/408801?v=3","gravatar_id":"","url":"https://api.github.com/users/2600hz","html_url":"https://github.com/2600hz","followers_url":"https://api.github.com/users/2600hz/followers","following_url":"https://api.github.com/users/2600hz/following{/other_user}","gists_url":"https://api.github.com/users/2600hz/gists{/gist_id}","starred_url":"https://api.github.com/users/2600hz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2600hz/subscriptions","organizations_url":"https://api.github.com/users/2600hz/orgs","repos_url":"https://api.github.com/users/2600hz/repos","events_url":"https://api.github.com/users/2600hz/events{/privacy}","received_events_url":"https://api.github.com/users/2600hz/received_events","type":"Organization","site_admin":false},"repo":{"id":2966241,"name":"kazoo","full_name":"2600hz/kazoo","owner":{"login":"2600hz","id":408801,"avatar_url":"https://avatars.githubusercontent.com/u/408801?v=3","gravatar_id":"","url":"https://api.github.com/users/2600hz","html_url":"https://github.com/2600hz","followers_url":"https://api.github.com/users/2600hz/followers","following_url":"https://api.github.com/users/2600hz/following{/other_user}","gists_url":"https://api.github.com/users/2600hz/gists{/gist_id}","starred_url":"https://api.github.com/users/2600hz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2600hz/subscriptions","organizations_url":"https://api.github.com/users/2600hz/orgs","repos_url":"https://api.github.com/users/2600hz/repos","events_url":"https://api.github.com/users/2600hz/events{/privacy}","received_events_url":"https://api.github.com/users/2600hz/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/2600hz/kazoo","description":"","fork":false,"url":"https://api.github.com/repos/2600hz/kazoo","forks_url":"https://api.github.com/repos/2600hz/kazoo/forks","keys_url":"https://api.github.com/repos/2600hz/kazoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/2600hz/kazoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/2600hz/kazoo/teams","hooks_url":"https://api.github.com/repos/2600hz/kazoo/hooks","issue_events_url":"https://api.github.com/repos/2600hz/kazoo/issues/events{/number}","events_url":"https://api.github.com/repos/2600hz/kazoo/events","assignees_url":"https://api.github.com/repos/2600hz/kazoo/assignees{/user}","branches_url":"https://api.github.com/repos/2600hz/kazoo/branches{/branch}","tags_url":"https://api.github.com/repos/2600hz/kazoo/tags","blobs_url":"https://api.github.com/repos/2600hz/kazoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/2600hz/kazoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/2600hz/kazoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/2600hz/kazoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/2600hz/kazoo/statuses/{sha}","languages_url":"https://api.github.com/repos/2600hz/kazoo/languages","stargazers_url":"https://api.github.com/repos/2600hz/kazoo/stargazers","contributors_url":"https://api.github.com/repos/2600hz/kazoo/contributors","subscribers_url":"https://api.github.com/repos/2600hz/kazoo/subscribers","subscription_url":"https://api.github.com/repos/2600hz/kazoo/subscription","commits_url":"https://api.github.com/repos/2600hz/kazoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/2600hz/kazoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/2600hz/kazoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/2600hz/kazoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/2600hz/kazoo/contents/{+path}","compare_url":"https://api.github.com/repos/2600hz/kazoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/2600hz/kazoo/merges","archive_url":"https://api.github.com/repos/2600hz/kazoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/2600hz/kazoo/downloads","issues_url":"https://api.github.com/repos/2600hz/kazoo/issues{/number}","pulls_url":"https://api.github.com/repos/2600hz/kazoo/pulls{/number}","milestones_url":"https://api.github.com/repos/2600hz/kazoo/milestones{/number}","notifications_url":"https://api.github.com/repos/2600hz/kazoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/2600hz/kazoo/labels{/name}","releases_url":"https://api.github.com/repos/2600hz/kazoo/releases{/id}","created_at":"2011-12-12T18:08:02Z","updated_at":"2015-10-12T10:44:17Z","pushed_at":"2015-10-13T19:26:48Z","git_url":"git://github.com/2600hz/kazoo.git","ssh_url":"git@github.com:2600hz/kazoo.git","clone_url":"https://github.com/2600hz/kazoo.git","svn_url":"https://github.com/2600hz/kazoo","homepage":"","size":556843,"stargazers_count":297,"watchers_count":297,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":149,"mirror_url":null,"open_issues_count":20,"forks":149,"open_issues":20,"watchers":297,"default_branch":"master"}},"base":{"label":"2600hz:master","ref":"master","sha":"439f475273c5856710de1d2a6ad6d9cc9ffaf9a4","user":{"login":"2600hz","id":408801,"avatar_url":"https://avatars.githubusercontent.com/u/408801?v=3","gravatar_id":"","url":"https://api.github.com/users/2600hz","html_url":"https://github.com/2600hz","followers_url":"https://api.github.com/users/2600hz/followers","following_url":"https://api.github.com/users/2600hz/following{/other_user}","gists_url":"https://api.github.com/users/2600hz/gists{/gist_id}","starred_url":"https://api.github.com/users/2600hz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2600hz/subscriptions","organizations_url":"https://api.github.com/users/2600hz/orgs","repos_url":"https://api.github.com/users/2600hz/repos","events_url":"https://api.github.com/users/2600hz/events{/privacy}","received_events_url":"https://api.github.com/users/2600hz/received_events","type":"Organization","site_admin":false},"repo":{"id":2966241,"name":"kazoo","full_name":"2600hz/kazoo","owner":{"login":"2600hz","id":408801,"avatar_url":"https://avatars.githubusercontent.com/u/408801?v=3","gravatar_id":"","url":"https://api.github.com/users/2600hz","html_url":"https://github.com/2600hz","followers_url":"https://api.github.com/users/2600hz/followers","following_url":"https://api.github.com/users/2600hz/following{/other_user}","gists_url":"https://api.github.com/users/2600hz/gists{/gist_id}","starred_url":"https://api.github.com/users/2600hz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/2600hz/subscriptions","organizations_url":"https://api.github.com/users/2600hz/orgs","repos_url":"https://api.github.com/users/2600hz/repos","events_url":"https://api.github.com/users/2600hz/events{/privacy}","received_events_url":"https://api.github.com/users/2600hz/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/2600hz/kazoo","description":"","fork":false,"url":"https://api.github.com/repos/2600hz/kazoo","forks_url":"https://api.github.com/repos/2600hz/kazoo/forks","keys_url":"https://api.github.com/repos/2600hz/kazoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/2600hz/kazoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/2600hz/kazoo/teams","hooks_url":"https://api.github.com/repos/2600hz/kazoo/hooks","issue_events_url":"https://api.github.com/repos/2600hz/kazoo/issues/events{/number}","events_url":"https://api.github.com/repos/2600hz/kazoo/events","assignees_url":"https://api.github.com/repos/2600hz/kazoo/assignees{/user}","branches_url":"https://api.github.com/repos/2600hz/kazoo/branches{/branch}","tags_url":"https://api.github.com/repos/2600hz/kazoo/tags","blobs_url":"https://api.github.com/repos/2600hz/kazoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/2600hz/kazoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/2600hz/kazoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/2600hz/kazoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/2600hz/kazoo/statuses/{sha}","languages_url":"https://api.github.com/repos/2600hz/kazoo/languages","stargazers_url":"https://api.github.com/repos/2600hz/kazoo/stargazers","contributors_url":"https://api.github.com/repos/2600hz/kazoo/contributors","subscribers_url":"https://api.github.com/repos/2600hz/kazoo/subscribers","subscription_url":"https://api.github.com/repos/2600hz/kazoo/subscription","commits_url":"https://api.github.com/repos/2600hz/kazoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/2600hz/kazoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/2600hz/kazoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/2600hz/kazoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/2600hz/kazoo/contents/{+path}","compare_url":"https://api.github.com/repos/2600hz/kazoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/2600hz/kazoo/merges","archive_url":"https://api.github.com/repos/2600hz/kazoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/2600hz/kazoo/downloads","issues_url":"https://api.github.com/repos/2600hz/kazoo/issues{/number}","pulls_url":"https://api.github.com/repos/2600hz/kazoo/pulls{/number}","milestones_url":"https://api.github.com/repos/2600hz/kazoo/milestones{/number}","notifications_url":"https://api.github.com/repos/2600hz/kazoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/2600hz/kazoo/labels{/name}","releases_url":"https://api.github.com/repos/2600hz/kazoo/releases{/id}","created_at":"2011-12-12T18:08:02Z","updated_at":"2015-10-12T10:44:17Z","pushed_at":"2015-10-13T19:26:48Z","git_url":"git://github.com/2600hz/kazoo.git","ssh_url":"git@github.com:2600hz/kazoo.git","clone_url":"https://github.com/2600hz/kazoo.git","svn_url":"https://github.com/2600hz/kazoo","homepage":"","size":556843,"stargazers_count":297,"watchers_count":297,"language":"Erlang","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":149,"mirror_url":null,"open_issues_count":20,"forks":149,"open_issues":20,"watchers":297,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/1358"},"html":{"href":"https://github.com/2600hz/kazoo/pull/1358"},"issue":{"href":"https://api.github.com/repos/2600hz/kazoo/issues/1358"},"comments":{"href":"https://api.github.com/repos/2600hz/kazoo/issues/1358/comments"},"review_comments":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/1358/comments"},"review_comment":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/2600hz/kazoo/pulls/1358/commits"},"statuses":{"href":"https://api.github.com/repos/2600hz/kazoo/statuses/6b2327c3174955d8b4038b13ffa210b18ca7fc0a"}}}}