{"action":"created","issue":{"url":"https://api.github.com/repos/OfficeDev/PnP-JS-Core/issues/63","repository_url":"https://api.github.com/repos/OfficeDev/PnP-JS-Core","labels_url":"https://api.github.com/repos/OfficeDev/PnP-JS-Core/issues/63/labels{/name}","comments_url":"https://api.github.com/repos/OfficeDev/PnP-JS-Core/issues/63/comments","events_url":"https://api.github.com/repos/OfficeDev/PnP-JS-Core/issues/63/events","html_url":"https://github.com/OfficeDev/PnP-JS-Core/pull/63","id":150703609,"number":63,"title":"Coding Out Search Service - WIP & for review","user":{"login":"tobiaswest83","id":13330650,"avatar_url":"https://avatars.githubusercontent.com/u/13330650?v=3","gravatar_id":"","url":"https://api.github.com/users/tobiaswest83","html_url":"https://github.com/tobiaswest83","followers_url":"https://api.github.com/users/tobiaswest83/followers","following_url":"https://api.github.com/users/tobiaswest83/following{/other_user}","gists_url":"https://api.github.com/users/tobiaswest83/gists{/gist_id}","starred_url":"https://api.github.com/users/tobiaswest83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobiaswest83/subscriptions","organizations_url":"https://api.github.com/users/tobiaswest83/orgs","repos_url":"https://api.github.com/users/tobiaswest83/repos","events_url":"https://api.github.com/users/tobiaswest83/events{/privacy}","received_events_url":"https://api.github.com/users/tobiaswest83/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-04-24T21:53:08Z","updated_at":"2016-04-25T21:53:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OfficeDev/PnP-JS-Core/pulls/63","html_url":"https://github.com/OfficeDev/PnP-JS-Core/pull/63","diff_url":"https://github.com/OfficeDev/PnP-JS-Core/pull/63.diff","patch_url":"https://github.com/OfficeDev/PnP-JS-Core/pull/63.patch"},"body":"## Issue 59 - WIP!!!\r\n\r\nThis is my WIP for #59. I am interested in feedback on \r\n1. approach so far\r\n2. further enhancements \r\n3. other things people would like to see in the returned object (looking at you @mike-morrison :-)) \r\n\r\nThis is *not* intended to be a final release, it's really just for others to review my approach. I have tried to ensure that the properties exposed match the properties available in the API (including settings defaults, where they are defined in the API). \r\n\r\nThere are a few exceptions, `SelectProperties` for example is a string in the GET API, but as a consumer it would make for a poor experience if they have to type \"Title,Author\", better for them to build an array, as shown below. \r\n\r\n### Usage\r\n\r\nTo use this in the browser, build as documented and (assuming you have a SharePoint page set up) run the following in the console. You'll also be able to better examine the returned object\r\n\r\n```javascript\r\nvar s = pnp.sharepoint.rest.web.search;\r\ns.QueryText = \"test\"\r\n// s.SelectProperties = [\"Title\", \"Author\", \"Byline\"]\r\n\r\ns.getSearchResults().then(function(data){\r\n    console.log(data);\r\n;});\r\n\r\n```\r\n\r\nThis returns the following\r\n\r\n```json\r\n{\r\n   \"RawSearchResults\":\"THEACTUALRESULTSFROMSHAREPOINT\",\r\n   \"PrimarySearchResults\":[\r\n      {\r\n         \"Title\":\"Test\",\r\n         \"Author\":\"Tobias West\",\r\n         \"Byline\":\"This is the article byline!\"\r\n      },\r\n     {\r\n         \"Title\":\"Test 2\",\r\n         \"Author\":\"Tobias West\",\r\n         \"Byline\":\"This is the article 2 byline!\"\r\n      },\r\n   ]\r\n}\r\n}\r\n```\r\n\r\n### TODO\r\n\r\n- write tests, ensure code coverage is appropriate document\r\n- handle more advanced scenarios in the returned data set, such as paging, grouping, SecondaryQueryResults etc. \r\n- handle POST @patrick-rodgers  I was considering whether `Queryable` should have a public post method which processes the same `query` collection to build the POST body, thoughts?\r\n- Sort object & implementation\r\n- A few other, rarely used properties which I need to R&D more. \r\n\r\n### Final notes\r\n\r\nThere are a few files in the PR I shouldn't have included, but since we're not integrating I'm not too worried about that. The final PR would be tidy with appropriate commit messages :)"},"comment":{"url":"https://api.github.com/repos/OfficeDev/PnP-JS-Core/issues/comments/214538871","html_url":"https://github.com/OfficeDev/PnP-JS-Core/pull/63#issuecomment-214538871","issue_url":"https://api.github.com/repos/OfficeDev/PnP-JS-Core/issues/63","id":214538871,"user":{"login":"tobiaswest83","id":13330650,"avatar_url":"https://avatars.githubusercontent.com/u/13330650?v=3","gravatar_id":"","url":"https://api.github.com/users/tobiaswest83","html_url":"https://github.com/tobiaswest83","followers_url":"https://api.github.com/users/tobiaswest83/followers","following_url":"https://api.github.com/users/tobiaswest83/following{/other_user}","gists_url":"https://api.github.com/users/tobiaswest83/gists{/gist_id}","starred_url":"https://api.github.com/users/tobiaswest83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobiaswest83/subscriptions","organizations_url":"https://api.github.com/users/tobiaswest83/orgs","repos_url":"https://api.github.com/users/tobiaswest83/repos","events_url":"https://api.github.com/users/tobiaswest83/events{/privacy}","received_events_url":"https://api.github.com/users/tobiaswest83/received_events","type":"User","site_admin":false},"created_at":"2016-04-25T21:53:10Z","updated_at":"2016-04-25T21:53:10Z","body":"Cool, I'm working to that approach. I won't be mapping out a SearchField interface, it will be unwieldy and seldom used IMO - almost all projects I've been involed in require us creating custom content types and/or using an alias against refiners. \r\n\r\n@patrick-rodgers feel free to close this - I think I've got some great feedback!"}}