{"action":"created","comment":{"url":"https://api.github.com/repos/sailorproject/sailor/pulls/comments/73795610","id":73795610,"diff_hunk":"@@ -0,0 +1,50 @@\n+local elastic = require \"sailor.db.elasticsearch\"\n+local Emodel = {}\n+\n+\n+Emodel.new = function(model_name)\n+\t\n+\tlocal self = {}\n+\tlocal ob = require(\"models.\"..model_name)\n+\tEtype = ob.type\n+\tkeys = ob.keys\t\n+\tlocal parameters={}\n+\t-- This method should be used when you are saving the parameters. If second parameter is present,\n+\t-- it will write that value into ES\n+\tself.save = function(id, ...)\n+\t\tif ... ~= nil and type(...) == \"table\" then \n+\t\t\treturn elastic.index(Etype, id , ...)\n+\t\telse\n+\t\t\treturn elastic.index(Etype, id, parameters)\n+\t\tend\n+\tend\n+\n+\t-- Get a document using ID\n+\tself.get = function(id)\n+\t\treturn elastic.get(Etype, id)\n+\tend\n+\t-- Delete a document using ID\n+\tself.delete = function(id)\n+\t\treturn elastic.delete(Etype,id)\n+\tend\n+\tself.search = function(word)\n+\t\treturn elastic.search(Etype, word)","path":"src/sailor/db/elastic_model.lua","position":31,"original_position":31,"commit_id":"67e54ef025f968facaf35df5cce8be0ec99b9d34","original_commit_id":"67e54ef025f968facaf35df5cce8be0ec99b9d34","user":{"login":"pmusa","id":361280,"avatar_url":"https://avatars.githubusercontent.com/u/361280?v=3","gravatar_id":"","url":"https://api.github.com/users/pmusa","html_url":"https://github.com/pmusa","followers_url":"https://api.github.com/users/pmusa/followers","following_url":"https://api.github.com/users/pmusa/following{/other_user}","gists_url":"https://api.github.com/users/pmusa/gists{/gist_id}","starred_url":"https://api.github.com/users/pmusa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmusa/subscriptions","organizations_url":"https://api.github.com/users/pmusa/orgs","repos_url":"https://api.github.com/users/pmusa/repos","events_url":"https://api.github.com/users/pmusa/events{/privacy}","received_events_url":"https://api.github.com/users/pmusa/received_events","type":"User","site_admin":false},"body":"I guess that we can search for than one single word. We usually call it query in the search world. But if query conflicts with the notion of queries in relational databases, you can call them `terms` (it is still not correct as people can have something like `+fox -quick`).","created_at":"2016-08-07T04:30:12Z","updated_at":"2016-08-07T04:30:12Z","html_url":"https://github.com/sailorproject/sailor/pull/125#discussion_r73795610","pull_request_url":"https://api.github.com/repos/sailorproject/sailor/pulls/125","_links":{"self":{"href":"https://api.github.com/repos/sailorproject/sailor/pulls/comments/73795610"},"html":{"href":"https://github.com/sailorproject/sailor/pull/125#discussion_r73795610"},"pull_request":{"href":"https://api.github.com/repos/sailorproject/sailor/pulls/125"}}},"pull_request":{"url":"https://api.github.com/repos/sailorproject/sailor/pulls/125","id":79230789,"html_url":"https://github.com/sailorproject/sailor/pull/125","diff_url":"https://github.com/sailorproject/sailor/pull/125.diff","patch_url":"https://github.com/sailorproject/sailor/pull/125.patch","issue_url":"https://api.github.com/repos/sailorproject/sailor/issues/125","number":125,"state":"open","locked":false,"title":"Work in Progress: Elasticsearch Integration into Sailor","user":{"login":"rnikhil275","id":8023571,"avatar_url":"https://avatars.githubusercontent.com/u/8023571?v=3","gravatar_id":"","url":"https://api.github.com/users/rnikhil275","html_url":"https://github.com/rnikhil275","followers_url":"https://api.github.com/users/rnikhil275/followers","following_url":"https://api.github.com/users/rnikhil275/following{/other_user}","gists_url":"https://api.github.com/users/rnikhil275/gists{/gist_id}","starred_url":"https://api.github.com/users/rnikhil275/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnikhil275/subscriptions","organizations_url":"https://api.github.com/users/rnikhil275/orgs","repos_url":"https://api.github.com/users/rnikhil275/repos","events_url":"https://api.github.com/users/rnikhil275/events{/privacy}","received_events_url":"https://api.github.com/users/rnikhil275/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-28T16:53:22Z","updated_at":"2016-08-07T04:30:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9a55e0232dc8a8fb761f92b5480ead93bcfdf5b1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sailorproject/sailor/pulls/125/commits","review_comments_url":"https://api.github.com/repos/sailorproject/sailor/pulls/125/comments","review_comment_url":"https://api.github.com/repos/sailorproject/sailor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sailorproject/sailor/issues/125/comments","statuses_url":"https://api.github.com/repos/sailorproject/sailor/statuses/67e54ef025f968facaf35df5cce8be0ec99b9d34","head":{"label":"rnikhil275:elasticsearch","ref":"elasticsearch","sha":"67e54ef025f968facaf35df5cce8be0ec99b9d34","user":{"login":"rnikhil275","id":8023571,"avatar_url":"https://avatars.githubusercontent.com/u/8023571?v=3","gravatar_id":"","url":"https://api.github.com/users/rnikhil275","html_url":"https://github.com/rnikhil275","followers_url":"https://api.github.com/users/rnikhil275/followers","following_url":"https://api.github.com/users/rnikhil275/following{/other_user}","gists_url":"https://api.github.com/users/rnikhil275/gists{/gist_id}","starred_url":"https://api.github.com/users/rnikhil275/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnikhil275/subscriptions","organizations_url":"https://api.github.com/users/rnikhil275/orgs","repos_url":"https://api.github.com/users/rnikhil275/repos","events_url":"https://api.github.com/users/rnikhil275/events{/privacy}","received_events_url":"https://api.github.com/users/rnikhil275/received_events","type":"User","site_admin":false},"repo":{"id":57442568,"name":"sailor","full_name":"rnikhil275/sailor","owner":{"login":"rnikhil275","id":8023571,"avatar_url":"https://avatars.githubusercontent.com/u/8023571?v=3","gravatar_id":"","url":"https://api.github.com/users/rnikhil275","html_url":"https://github.com/rnikhil275","followers_url":"https://api.github.com/users/rnikhil275/followers","following_url":"https://api.github.com/users/rnikhil275/following{/other_user}","gists_url":"https://api.github.com/users/rnikhil275/gists{/gist_id}","starred_url":"https://api.github.com/users/rnikhil275/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnikhil275/subscriptions","organizations_url":"https://api.github.com/users/rnikhil275/orgs","repos_url":"https://api.github.com/users/rnikhil275/repos","events_url":"https://api.github.com/users/rnikhil275/events{/privacy}","received_events_url":"https://api.github.com/users/rnikhil275/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rnikhil275/sailor","description":"A Lua MVC Web Framework.","fork":true,"url":"https://api.github.com/repos/rnikhil275/sailor","forks_url":"https://api.github.com/repos/rnikhil275/sailor/forks","keys_url":"https://api.github.com/repos/rnikhil275/sailor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rnikhil275/sailor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rnikhil275/sailor/teams","hooks_url":"https://api.github.com/repos/rnikhil275/sailor/hooks","issue_events_url":"https://api.github.com/repos/rnikhil275/sailor/issues/events{/number}","events_url":"https://api.github.com/repos/rnikhil275/sailor/events","assignees_url":"https://api.github.com/repos/rnikhil275/sailor/assignees{/user}","branches_url":"https://api.github.com/repos/rnikhil275/sailor/branches{/branch}","tags_url":"https://api.github.com/repos/rnikhil275/sailor/tags","blobs_url":"https://api.github.com/repos/rnikhil275/sailor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rnikhil275/sailor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rnikhil275/sailor/git/refs{/sha}","trees_url":"https://api.github.com/repos/rnikhil275/sailor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rnikhil275/sailor/statuses/{sha}","languages_url":"https://api.github.com/repos/rnikhil275/sailor/languages","stargazers_url":"https://api.github.com/repos/rnikhil275/sailor/stargazers","contributors_url":"https://api.github.com/repos/rnikhil275/sailor/contributors","subscribers_url":"https://api.github.com/repos/rnikhil275/sailor/subscribers","subscription_url":"https://api.github.com/repos/rnikhil275/sailor/subscription","commits_url":"https://api.github.com/repos/rnikhil275/sailor/commits{/sha}","git_commits_url":"https://api.github.com/repos/rnikhil275/sailor/git/commits{/sha}","comments_url":"https://api.github.com/repos/rnikhil275/sailor/comments{/number}","issue_comment_url":"https://api.github.com/repos/rnikhil275/sailor/issues/comments{/number}","contents_url":"https://api.github.com/repos/rnikhil275/sailor/contents/{+path}","compare_url":"https://api.github.com/repos/rnikhil275/sailor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rnikhil275/sailor/merges","archive_url":"https://api.github.com/repos/rnikhil275/sailor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rnikhil275/sailor/downloads","issues_url":"https://api.github.com/repos/rnikhil275/sailor/issues{/number}","pulls_url":"https://api.github.com/repos/rnikhil275/sailor/pulls{/number}","milestones_url":"https://api.github.com/repos/rnikhil275/sailor/milestones{/number}","notifications_url":"https://api.github.com/repos/rnikhil275/sailor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rnikhil275/sailor/labels{/name}","releases_url":"https://api.github.com/repos/rnikhil275/sailor/releases{/id}","deployments_url":"https://api.github.com/repos/rnikhil275/sailor/deployments","created_at":"2016-04-30T13:16:42Z","updated_at":"2016-04-30T13:16:43Z","pushed_at":"2016-08-04T08:23:33Z","git_url":"git://github.com/rnikhil275/sailor.git","ssh_url":"git@github.com:rnikhil275/sailor.git","clone_url":"https://github.com/rnikhil275/sailor.git","svn_url":"https://github.com/rnikhil275/sailor","homepage":"http://sailorproject.org","size":1873,"stargazers_count":0,"watchers_count":0,"language":"Lua","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sailorproject:master","ref":"master","sha":"a8e470b6c6a54064287cfc0e31623db253e9f85a","user":{"login":"sailorproject","id":16668978,"avatar_url":"https://avatars.githubusercontent.com/u/16668978?v=3","gravatar_id":"","url":"https://api.github.com/users/sailorproject","html_url":"https://github.com/sailorproject","followers_url":"https://api.github.com/users/sailorproject/followers","following_url":"https://api.github.com/users/sailorproject/following{/other_user}","gists_url":"https://api.github.com/users/sailorproject/gists{/gist_id}","starred_url":"https://api.github.com/users/sailorproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sailorproject/subscriptions","organizations_url":"https://api.github.com/users/sailorproject/orgs","repos_url":"https://api.github.com/users/sailorproject/repos","events_url":"https://api.github.com/users/sailorproject/events{/privacy}","received_events_url":"https://api.github.com/users/sailorproject/received_events","type":"Organization","site_admin":false},"repo":{"id":15582132,"name":"sailor","full_name":"sailorproject/sailor","owner":{"login":"sailorproject","id":16668978,"avatar_url":"https://avatars.githubusercontent.com/u/16668978?v=3","gravatar_id":"","url":"https://api.github.com/users/sailorproject","html_url":"https://github.com/sailorproject","followers_url":"https://api.github.com/users/sailorproject/followers","following_url":"https://api.github.com/users/sailorproject/following{/other_user}","gists_url":"https://api.github.com/users/sailorproject/gists{/gist_id}","starred_url":"https://api.github.com/users/sailorproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sailorproject/subscriptions","organizations_url":"https://api.github.com/users/sailorproject/orgs","repos_url":"https://api.github.com/users/sailorproject/repos","events_url":"https://api.github.com/users/sailorproject/events{/privacy}","received_events_url":"https://api.github.com/users/sailorproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sailorproject/sailor","description":"A Lua MVC Web Framework.","fork":false,"url":"https://api.github.com/repos/sailorproject/sailor","forks_url":"https://api.github.com/repos/sailorproject/sailor/forks","keys_url":"https://api.github.com/repos/sailorproject/sailor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sailorproject/sailor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sailorproject/sailor/teams","hooks_url":"https://api.github.com/repos/sailorproject/sailor/hooks","issue_events_url":"https://api.github.com/repos/sailorproject/sailor/issues/events{/number}","events_url":"https://api.github.com/repos/sailorproject/sailor/events","assignees_url":"https://api.github.com/repos/sailorproject/sailor/assignees{/user}","branches_url":"https://api.github.com/repos/sailorproject/sailor/branches{/branch}","tags_url":"https://api.github.com/repos/sailorproject/sailor/tags","blobs_url":"https://api.github.com/repos/sailorproject/sailor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sailorproject/sailor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sailorproject/sailor/git/refs{/sha}","trees_url":"https://api.github.com/repos/sailorproject/sailor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sailorproject/sailor/statuses/{sha}","languages_url":"https://api.github.com/repos/sailorproject/sailor/languages","stargazers_url":"https://api.github.com/repos/sailorproject/sailor/stargazers","contributors_url":"https://api.github.com/repos/sailorproject/sailor/contributors","subscribers_url":"https://api.github.com/repos/sailorproject/sailor/subscribers","subscription_url":"https://api.github.com/repos/sailorproject/sailor/subscription","commits_url":"https://api.github.com/repos/sailorproject/sailor/commits{/sha}","git_commits_url":"https://api.github.com/repos/sailorproject/sailor/git/commits{/sha}","comments_url":"https://api.github.com/repos/sailorproject/sailor/comments{/number}","issue_comment_url":"https://api.github.com/repos/sailorproject/sailor/issues/comments{/number}","contents_url":"https://api.github.com/repos/sailorproject/sailor/contents/{+path}","compare_url":"https://api.github.com/repos/sailorproject/sailor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sailorproject/sailor/merges","archive_url":"https://api.github.com/repos/sailorproject/sailor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sailorproject/sailor/downloads","issues_url":"https://api.github.com/repos/sailorproject/sailor/issues{/number}","pulls_url":"https://api.github.com/repos/sailorproject/sailor/pulls{/number}","milestones_url":"https://api.github.com/repos/sailorproject/sailor/milestones{/number}","notifications_url":"https://api.github.com/repos/sailorproject/sailor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sailorproject/sailor/labels{/name}","releases_url":"https://api.github.com/repos/sailorproject/sailor/releases{/id}","deployments_url":"https://api.github.com/repos/sailorproject/sailor/deployments","created_at":"2014-01-02T11:29:24Z","updated_at":"2016-08-05T03:12:22Z","pushed_at":"2016-08-04T08:23:33Z","git_url":"git://github.com/sailorproject/sailor.git","ssh_url":"git@github.com:sailorproject/sailor.git","clone_url":"https://github.com/sailorproject/sailor.git","svn_url":"https://github.com/sailorproject/sailor","homepage":"http://sailorproject.org","size":2028,"stargazers_count":622,"watchers_count":622,"language":"Lua","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":90,"mirror_url":null,"open_issues_count":35,"forks":90,"open_issues":35,"watchers":622,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sailorproject/sailor/pulls/125"},"html":{"href":"https://github.com/sailorproject/sailor/pull/125"},"issue":{"href":"https://api.github.com/repos/sailorproject/sailor/issues/125"},"comments":{"href":"https://api.github.com/repos/sailorproject/sailor/issues/125/comments"},"review_comments":{"href":"https://api.github.com/repos/sailorproject/sailor/pulls/125/comments"},"review_comment":{"href":"https://api.github.com/repos/sailorproject/sailor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sailorproject/sailor/pulls/125/commits"},"statuses":{"href":"https://api.github.com/repos/sailorproject/sailor/statuses/67e54ef025f968facaf35df5cce8be0ec99b9d34"}}}}
{"actor":{"display_login":"pmusa"}}