{"action":"created","issue":{"url":"https://api.github.com/repos/OfficeDev/PnP-JS-Core/issues/70","repository_url":"https://api.github.com/repos/OfficeDev/PnP-JS-Core","labels_url":"https://api.github.com/repos/OfficeDev/PnP-JS-Core/issues/70/labels{/name}","comments_url":"https://api.github.com/repos/OfficeDev/PnP-JS-Core/issues/70/comments","events_url":"https://api.github.com/repos/OfficeDev/PnP-JS-Core/issues/70/events","html_url":"https://github.com/OfficeDev/PnP-JS-Core/pull/70","id":151221552,"number":70,"title":"Issue 59 - Coding out of Search","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":5,"created_at":"2016-04-26T19:40:44Z","updated_at":"2016-04-26T22:21:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OfficeDev/PnP-JS-Core/pulls/70","html_url":"https://github.com/OfficeDev/PnP-JS-Core/pull/70","diff_url":"https://github.com/OfficeDev/PnP-JS-Core/pull/70.diff","patch_url":"https://github.com/OfficeDev/PnP-JS-Core/pull/70.patch"},"body":"Closes #59 \r\n\r\nCoverage at 76%, cannot increase coverage without browser testing which is hooked up up a tenant. I believe someone's thinking about this?\r\n\r\nAs always, feedback welcome. \r\n\r\n### Summary\r\nThere are three core components\r\n- `SearchQuery` - an interface which defines the properties passed as part of the search body\r\n- `SearchResult` - a class which returns a formatted PrimarySearchResults object, a few other useful properties and the raw results\r\n- `Search` Takes a `SearchQuery` in the constructor, processes the query and returns a `SearchResult`\r\n\r\nThere are a number of smaller, self-explanatory classes, interfaces and enums\r\n\r\n#### SearchResult example\r\n\r\n```json\r\n{\r\n   \"RawSearchResults\":\"THEACTUALRESULTSFROMSHAREPOINT\",\r\n   \"RowCount\": 100,\r\n   \"TotalRows\": 234,\r\n   \"TotalRowsIncludingDuplicates\": 567,\r\n   \"ElapsedTime\": 123,\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### Usage\r\n\r\nConforms with the fluid approach, note that I have moved it to the same level as site and web, feel it didn't need to be a child of one or both, are you OK with that @patrick-rodgers? If not, I can move it into web and/or site.\r\n\r\nIf using a supported IDE, intellisense is provided by the pnp.d.ts, allowing for super-quick creation of search queries.  \r\n\r\n```javascript\r\npnp.sp.search({Querytext:\"test\", RowLimit:500, SelectProperties: ['Title', 'ContentType'], StartRow: 11, RowsPerPage: 10, SortList: [{Property:'Rank', Direction:0}]}).get().then(function(data){console.log(data);})\r\n```"},"comment":{"url":"https://api.github.com/repos/OfficeDev/PnP-JS-Core/issues/comments/214905473","html_url":"https://github.com/OfficeDev/PnP-JS-Core/pull/70#issuecomment-214905473","issue_url":"https://api.github.com/repos/OfficeDev/PnP-JS-Core/issues/70","id":214905473,"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-26T22:21:18Z","updated_at":"2016-04-26T22:21:18Z","body":"Updated based on your feedback @patrick-rodgers \r\n\r\nWas going to rebase to flatten the commit log, but there were conflicts which terrified me a bit!"}}