SlideShare a Scribd company logo
1 of 11
Grokking search via CSOM/JSOM and REST 
Mikael Svenson 
August 22 2014 
DNV GL © 2014 
DRAFT 
August 22 2014 SAFER, SMARTER, GREENER 
SOFTWARE 
SharePoint – Client Search API’s 
1
CSOM/JSOM 
 Client Side Object Model 
 JavaScript object model 
 http://msdn.microsoft.com/en-us/library/office/dn423226(v=office.15).aspx 
DNV GL © 2014 
DRAFT 
August 22 2014 
2
jQuery.ajax({ 
DNV GL © 2014 
DRAFT 
August 22 2014 
REST 
 http://msdn.microsoft.com/en-us/library/office/jj163876(v=office.15).aspx 
 Wrapper functions will help: 
http://www.skylinetechnologies.com/Blog/Article/2480/Using-the-SharePoint- 
2013-Search-REST-API.aspx 
3 
url: webUrl + "/_api/search/query?querytext='SharePoint'&rowlimit=10", 
type: "GET", 
headers: { "Accept": "application/json;odata=verbose" }, 
success: function (data) { 
var hitCount = data.d.query.PrimaryQueryResult.RelevantResults.TotalRows; 
var hitCountwithDuplicates = data.d.query.PrimaryQueryResult.RelevantResults.TotalRowsIncludingDuplicates; 
var results = data.d.query.PrimaryQueryResult.RelevantResults.Table.Rows.results; 
$.each(results, function () { 
$.each(this.Cells.results, function () { 
var propertyName = this.Key; 
var propertyValue = this.Value; 
}); 
}); 
/* get result blocks */ 
if (data.d.query.SecondaryQueryResults != null) { 
for (var i = 0; i < data.d.query.SecondaryQueryResults.results.length; i++) { 
var resultBlock = data.d.query.SecondaryQueryResults.results[i]; 
$.each(resultBlock.RelevantResults.Table.Rows.results, function () { 
$.each(this.Cells.results, function () { 
var propertyName = this.Key; 
var propertyValue = this.Value; 
}); 
}); 
} 
} 
}, 
error: function (data) { 
} 
});
SharePoint 2013 Search Query Tool 
 https://sp2013searchtool.codeplex.com/ 
DNV GL © 2014 
DRAFT 
August 22 2014 
4
Fiddler or similar to explore the JSON data 
DNV GL © 2014 
DRAFT 
August 22 2014 
5
Benefits of using CSOM 
 You can batch queries, optimizing query execution 
DNV GL © 2014 
DRAFT 
August 22 2014 
6
Batching with REST 
 Can be achieved using query rules and result blocks, but will limit the number of 
results per type to 10 
 That said, using a query rule with result blocks makes updates a lot easier if you 
need to change the search queries 
– Example: Intranet front page which shows 
– Top 4 articles 
– Top X blog posts 
– Latest user documents 
– etc 
DNV GL © 2014 
DRAFT 
August 22 2014 
7
Refiners with REST 
 Use the query tool 
 Specify the refiners you want returned 
 Pick values from the Refinement results table 
 Use the Refinement Token value 
and(ContentType:ǂǂ746578742f68746d6c3b20636861727365743d7574662d38,FileType:ǂǂ68746d6c) 
 The value is hex encoded 
and(ContentType:"text/html; charset=utf-8",FileType:html) 
DNV GL © 2014 
DRAFT 
August 22 2014 
8
Refiners in CSOM 
 Similar to REST, set the .Refiners property of the KeywordQuery object 
 Set the RefinementFilters property to add filters 
RefinementFilters.Add(<filter>) 
 http://techmikael.blogspot.no/2013/07/working-with-refiners-in-csomsharepoint. 
DNV GL © 2014 
DRAFT 
html 
August 22 2014 
9
Anonymous 
 Requires some configuration 
 http://msdn.microsoft.com/en-us/ 
library/office/jj163876(v=office.15).aspx#bk_AnonymousREST 
 Waldek Mastykarz is your man when it comes to anonymous and WCM 
 http://blog.mastykarz.nl/configuring-sharepoint-2013-search-rest-api-anonymous- 
 http://blog.mastykarz.nl/inconvenient-search-rest-api-anonymous-users/ 
 http://blog.mastykarz.nl/debugging-setting-properties-anonymous-search-rest-queries/ 
DNV GL © 2014 
DRAFT 
users/ 
August 22 2014 
10
Questions? 
SAFER, SMARTER, GREENER 
DNV GL © 2014 
DRAFT 
August 22 2014 
www.dnvgl.com 
11

More Related Content

What's hot

Project Up grade Ax 2012 R2 to Ax 2012 R3
Project Up grade Ax 2012 R2 to Ax 2012 R3Project Up grade Ax 2012 R2 to Ax 2012 R3
Project Up grade Ax 2012 R2 to Ax 2012 R3Miftahul Huda
 
Html5 essentials
Html5 essentialsHtml5 essentials
Html5 essentialsSEO SKills
 
Final Presentation
Final PresentationFinal Presentation
Final PresentationMahima Verma
 
The State of the Developer Ecosystem - .NET Conf Madrid 2018
The State of the Developer Ecosystem - .NET Conf Madrid 2018The State of the Developer Ecosystem - .NET Conf Madrid 2018
The State of the Developer Ecosystem - .NET Conf Madrid 2018Carlos Mendible
 
Restlet Framework NG
Restlet Framework NGRestlet Framework NG
Restlet Framework NGJerome Louvel
 
CodeMash 2013 Microsoft Data Stack
CodeMash 2013 Microsoft Data StackCodeMash 2013 Microsoft Data Stack
CodeMash 2013 Microsoft Data StackMike Benkovich
 

What's hot (10)

Project Up grade Ax 2012 R2 to Ax 2012 R3
Project Up grade Ax 2012 R2 to Ax 2012 R3Project Up grade Ax 2012 R2 to Ax 2012 R3
Project Up grade Ax 2012 R2 to Ax 2012 R3
 
Html5 essentials
Html5 essentialsHtml5 essentials
Html5 essentials
 
java Developing using asp.net
java Developing using asp.netjava Developing using asp.net
java Developing using asp.net
 
Next2019
Next2019Next2019
Next2019
 
Final Presentation
Final PresentationFinal Presentation
Final Presentation
 
The State of the Developer Ecosystem - .NET Conf Madrid 2018
The State of the Developer Ecosystem - .NET Conf Madrid 2018The State of the Developer Ecosystem - .NET Conf Madrid 2018
The State of the Developer Ecosystem - .NET Conf Madrid 2018
 
Introduction to Grails
Introduction to GrailsIntroduction to Grails
Introduction to Grails
 
Restlet Framework NG
Restlet Framework NGRestlet Framework NG
Restlet Framework NG
 
CodeMash 2013 Microsoft Data Stack
CodeMash 2013 Microsoft Data StackCodeMash 2013 Microsoft Data Stack
CodeMash 2013 Microsoft Data Stack
 
[TestWarez 2017] Automated Testing for Common Errors and Difference Recogniti...
[TestWarez 2017] Automated Testing for Common Errors and Difference Recogniti...[TestWarez 2017] Automated Testing for Common Errors and Difference Recogniti...
[TestWarez 2017] Automated Testing for Common Errors and Difference Recogniti...
 

Similar to Share point – client search api’s

RESTful Web Development with CakePHP
RESTful Web Development with CakePHPRESTful Web Development with CakePHP
RESTful Web Development with CakePHPAndru Weir
 
Timings API: Performance Assertion during the functional testing
 Timings API: Performance Assertion during the functional testing Timings API: Performance Assertion during the functional testing
Timings API: Performance Assertion during the functional testingPetrosPlakogiannis
 
SharePoint - Display Templates Overview
SharePoint - Display Templates OverviewSharePoint - Display Templates Overview
SharePoint - Display Templates OverviewMikael Svenson
 
Adopting AnswerModules ModuleSuite
Adopting AnswerModules ModuleSuiteAdopting AnswerModules ModuleSuite
Adopting AnswerModules ModuleSuiteAnswerModules
 
REST API 20.2 - Appworks Gateway Integration.pptx
REST API 20.2 - Appworks Gateway Integration.pptxREST API 20.2 - Appworks Gateway Integration.pptx
REST API 20.2 - Appworks Gateway Integration.pptxJason452803
 
Web Application Development using PHP and MySQL
Web Application Development using PHP and MySQLWeb Application Development using PHP and MySQL
Web Application Development using PHP and MySQLGanesh Kamath
 
AngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesAngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesRainer Stropek
 
Usability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET FeaturesUsability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET FeaturesPeter Gfader
 
RESTHeart - Modern runtime for microservices with instant Data API on MongoDB.
RESTHeart - Modern runtime for microservices with instant Data API on MongoDB.RESTHeart - Modern runtime for microservices with instant Data API on MongoDB.
RESTHeart - Modern runtime for microservices with instant Data API on MongoDB.SoftInstigate
 
SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015Pushkar Chivate
 
بررسی چارچوب جنگو
بررسی چارچوب جنگوبررسی چارچوب جنگو
بررسی چارچوب جنگوrailsbootcamp
 
Charla desarrollo de apps con sharepoint y office 365
Charla   desarrollo de apps con sharepoint y office 365Charla   desarrollo de apps con sharepoint y office 365
Charla desarrollo de apps con sharepoint y office 365Luis Valencia
 
Difference between asp.net mvc 3 and asp.net mvc 4
Difference between asp.net mvc 3 and asp.net mvc 4Difference between asp.net mvc 3 and asp.net mvc 4
Difference between asp.net mvc 3 and asp.net mvc 4Umar Ali
 
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!Evan Mullins
 
Reach End Users With Next Generation Web Applications
Reach End Users With Next Generation Web ApplicationsReach End Users With Next Generation Web Applications
Reach End Users With Next Generation Web ApplicationsJeff Blankenburg
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Matt Raible
 

Similar to Share point – client search api’s (20)

RESTful Web Development with CakePHP
RESTful Web Development with CakePHPRESTful Web Development with CakePHP
RESTful Web Development with CakePHP
 
Timings API: Performance Assertion during the functional testing
 Timings API: Performance Assertion during the functional testing Timings API: Performance Assertion during the functional testing
Timings API: Performance Assertion during the functional testing
 
SharePoint - Display Templates Overview
SharePoint - Display Templates OverviewSharePoint - Display Templates Overview
SharePoint - Display Templates Overview
 
Adopting AnswerModules ModuleSuite
Adopting AnswerModules ModuleSuiteAdopting AnswerModules ModuleSuite
Adopting AnswerModules ModuleSuite
 
REST API 20.2 - Appworks Gateway Integration.pptx
REST API 20.2 - Appworks Gateway Integration.pptxREST API 20.2 - Appworks Gateway Integration.pptx
REST API 20.2 - Appworks Gateway Integration.pptx
 
Web Application Development using PHP and MySQL
Web Application Development using PHP and MySQLWeb Application Development using PHP and MySQL
Web Application Development using PHP and MySQL
 
Angular js
Angular jsAngular js
Angular js
 
AngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile ServicesAngularJS with TypeScript and Windows Azure Mobile Services
AngularJS with TypeScript and Windows Azure Mobile Services
 
Usability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET FeaturesUsability AJAX and other ASP.NET Features
Usability AJAX and other ASP.NET Features
 
RESTHeart - Modern runtime for microservices with instant Data API on MongoDB.
RESTHeart - Modern runtime for microservices with instant Data API on MongoDB.RESTHeart - Modern runtime for microservices with instant Data API on MongoDB.
RESTHeart - Modern runtime for microservices with instant Data API on MongoDB.
 
SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015SharePoint Saturday Atlanta 2015
SharePoint Saturday Atlanta 2015
 
بررسی چارچوب جنگو
بررسی چارچوب جنگوبررسی چارچوب جنگو
بررسی چارچوب جنگو
 
AngularJS 1.x training
AngularJS 1.x trainingAngularJS 1.x training
AngularJS 1.x training
 
Charla desarrollo de apps con sharepoint y office 365
Charla   desarrollo de apps con sharepoint y office 365Charla   desarrollo de apps con sharepoint y office 365
Charla desarrollo de apps con sharepoint y office 365
 
Difference between asp.net mvc 3 and asp.net mvc 4
Difference between asp.net mvc 3 and asp.net mvc 4Difference between asp.net mvc 3 and asp.net mvc 4
Difference between asp.net mvc 3 and asp.net mvc 4
 
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
 
Reach End Users With Next Generation Web Applications
Reach End Users With Next Generation Web ApplicationsReach End Users With Next Generation Web Applications
Reach End Users With Next Generation Web Applications
 
Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017Front End Development for Back End Developers - UberConf 2017
Front End Development for Back End Developers - UberConf 2017
 
Mean stack Magics
Mean stack MagicsMean stack Magics
Mean stack Magics
 
Developing With Data Technologies
Developing With Data TechnologiesDeveloping With Data Technologies
Developing With Data Technologies
 

More from Mikael Svenson

Nyheter i O365-porteføljen og Office 2016
Nyheter i O365-porteføljen og Office 2016Nyheter i O365-porteføljen og Office 2016
Nyheter i O365-porteføljen og Office 2016Mikael Svenson
 
Office graph - Is it your cup of tea?
Office graph - Is it your cup of tea?Office graph - Is it your cup of tea?
Office graph - Is it your cup of tea?Mikael Svenson
 
SharePoint - The hybrid story and beyond
SharePoint - The hybrid story and beyondSharePoint - The hybrid story and beyond
SharePoint - The hybrid story and beyondMikael Svenson
 
Norwegian SharePoint Community - What happened at Ignite
Norwegian SharePoint Community - What happened at IgniteNorwegian SharePoint Community - What happened at Ignite
Norwegian SharePoint Community - What happened at IgniteMikael Svenson
 
SharePoint Search Queries Explained - SPSSthlm 2015
SharePoint Search Queries Explained - SPSSthlm 2015SharePoint Search Queries Explained - SPSSthlm 2015
SharePoint Search Queries Explained - SPSSthlm 2015Mikael Svenson
 
Techniques for Creating Social Refiners in SharePoint Search
Techniques for Creating Social Refiners in SharePoint SearchTechniques for Creating Social Refiners in SharePoint Search
Techniques for Creating Social Refiners in SharePoint SearchMikael Svenson
 
Search Queries Explained – A Deep Dive into Query Rules, Query Variables and ...
Search Queries Explained – A Deep Dive into Query Rules, Query Variables and ...Search Queries Explained – A Deep Dive into Query Rules, Query Variables and ...
Search Queries Explained – A Deep Dive into Query Rules, Query Variables and ...Mikael Svenson
 
Nsc 2013 06-17 - random rants on 2013
Nsc 2013 06-17 - random rants on 2013Nsc 2013 06-17 - random rants on 2013
Nsc 2013 06-17 - random rants on 2013Mikael Svenson
 
SharePoint Saturday Belgium - Contextual Search and More..
SharePoint Saturday Belgium - Contextual Search and More..SharePoint Saturday Belgium - Contextual Search and More..
SharePoint Saturday Belgium - Contextual Search and More..Mikael Svenson
 
Nsc 2011 09-21 search 101
Nsc 2011 09-21 search 101Nsc 2011 09-21 search 101
Nsc 2011 09-21 search 101Mikael Svenson
 
Er gratis søk egentlig noe tess
Er gratis søk egentlig noe tessEr gratis søk egentlig noe tess
Er gratis søk egentlig noe tessMikael Svenson
 

More from Mikael Svenson (11)

Nyheter i O365-porteføljen og Office 2016
Nyheter i O365-porteføljen og Office 2016Nyheter i O365-porteføljen og Office 2016
Nyheter i O365-porteføljen og Office 2016
 
Office graph - Is it your cup of tea?
Office graph - Is it your cup of tea?Office graph - Is it your cup of tea?
Office graph - Is it your cup of tea?
 
SharePoint - The hybrid story and beyond
SharePoint - The hybrid story and beyondSharePoint - The hybrid story and beyond
SharePoint - The hybrid story and beyond
 
Norwegian SharePoint Community - What happened at Ignite
Norwegian SharePoint Community - What happened at IgniteNorwegian SharePoint Community - What happened at Ignite
Norwegian SharePoint Community - What happened at Ignite
 
SharePoint Search Queries Explained - SPSSthlm 2015
SharePoint Search Queries Explained - SPSSthlm 2015SharePoint Search Queries Explained - SPSSthlm 2015
SharePoint Search Queries Explained - SPSSthlm 2015
 
Techniques for Creating Social Refiners in SharePoint Search
Techniques for Creating Social Refiners in SharePoint SearchTechniques for Creating Social Refiners in SharePoint Search
Techniques for Creating Social Refiners in SharePoint Search
 
Search Queries Explained – A Deep Dive into Query Rules, Query Variables and ...
Search Queries Explained – A Deep Dive into Query Rules, Query Variables and ...Search Queries Explained – A Deep Dive into Query Rules, Query Variables and ...
Search Queries Explained – A Deep Dive into Query Rules, Query Variables and ...
 
Nsc 2013 06-17 - random rants on 2013
Nsc 2013 06-17 - random rants on 2013Nsc 2013 06-17 - random rants on 2013
Nsc 2013 06-17 - random rants on 2013
 
SharePoint Saturday Belgium - Contextual Search and More..
SharePoint Saturday Belgium - Contextual Search and More..SharePoint Saturday Belgium - Contextual Search and More..
SharePoint Saturday Belgium - Contextual Search and More..
 
Nsc 2011 09-21 search 101
Nsc 2011 09-21 search 101Nsc 2011 09-21 search 101
Nsc 2011 09-21 search 101
 
Er gratis søk egentlig noe tess
Er gratis søk egentlig noe tessEr gratis søk egentlig noe tess
Er gratis søk egentlig noe tess
 

Recently uploaded

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 

Recently uploaded (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 

Share point – client search api’s

  • 1. Grokking search via CSOM/JSOM and REST Mikael Svenson August 22 2014 DNV GL © 2014 DRAFT August 22 2014 SAFER, SMARTER, GREENER SOFTWARE SharePoint – Client Search API’s 1
  • 2. CSOM/JSOM  Client Side Object Model  JavaScript object model  http://msdn.microsoft.com/en-us/library/office/dn423226(v=office.15).aspx DNV GL © 2014 DRAFT August 22 2014 2
  • 3. jQuery.ajax({ DNV GL © 2014 DRAFT August 22 2014 REST  http://msdn.microsoft.com/en-us/library/office/jj163876(v=office.15).aspx  Wrapper functions will help: http://www.skylinetechnologies.com/Blog/Article/2480/Using-the-SharePoint- 2013-Search-REST-API.aspx 3 url: webUrl + "/_api/search/query?querytext='SharePoint'&rowlimit=10", type: "GET", headers: { "Accept": "application/json;odata=verbose" }, success: function (data) { var hitCount = data.d.query.PrimaryQueryResult.RelevantResults.TotalRows; var hitCountwithDuplicates = data.d.query.PrimaryQueryResult.RelevantResults.TotalRowsIncludingDuplicates; var results = data.d.query.PrimaryQueryResult.RelevantResults.Table.Rows.results; $.each(results, function () { $.each(this.Cells.results, function () { var propertyName = this.Key; var propertyValue = this.Value; }); }); /* get result blocks */ if (data.d.query.SecondaryQueryResults != null) { for (var i = 0; i < data.d.query.SecondaryQueryResults.results.length; i++) { var resultBlock = data.d.query.SecondaryQueryResults.results[i]; $.each(resultBlock.RelevantResults.Table.Rows.results, function () { $.each(this.Cells.results, function () { var propertyName = this.Key; var propertyValue = this.Value; }); }); } } }, error: function (data) { } });
  • 4. SharePoint 2013 Search Query Tool  https://sp2013searchtool.codeplex.com/ DNV GL © 2014 DRAFT August 22 2014 4
  • 5. Fiddler or similar to explore the JSON data DNV GL © 2014 DRAFT August 22 2014 5
  • 6. Benefits of using CSOM  You can batch queries, optimizing query execution DNV GL © 2014 DRAFT August 22 2014 6
  • 7. Batching with REST  Can be achieved using query rules and result blocks, but will limit the number of results per type to 10  That said, using a query rule with result blocks makes updates a lot easier if you need to change the search queries – Example: Intranet front page which shows – Top 4 articles – Top X blog posts – Latest user documents – etc DNV GL © 2014 DRAFT August 22 2014 7
  • 8. Refiners with REST  Use the query tool  Specify the refiners you want returned  Pick values from the Refinement results table  Use the Refinement Token value and(ContentType:ǂǂ746578742f68746d6c3b20636861727365743d7574662d38,FileType:ǂǂ68746d6c)  The value is hex encoded and(ContentType:"text/html; charset=utf-8",FileType:html) DNV GL © 2014 DRAFT August 22 2014 8
  • 9. Refiners in CSOM  Similar to REST, set the .Refiners property of the KeywordQuery object  Set the RefinementFilters property to add filters RefinementFilters.Add(<filter>)  http://techmikael.blogspot.no/2013/07/working-with-refiners-in-csomsharepoint. DNV GL © 2014 DRAFT html August 22 2014 9
  • 10. Anonymous  Requires some configuration  http://msdn.microsoft.com/en-us/ library/office/jj163876(v=office.15).aspx#bk_AnonymousREST  Waldek Mastykarz is your man when it comes to anonymous and WCM  http://blog.mastykarz.nl/configuring-sharepoint-2013-search-rest-api-anonymous-  http://blog.mastykarz.nl/inconvenient-search-rest-api-anonymous-users/  http://blog.mastykarz.nl/debugging-setting-properties-anonymous-search-rest-queries/ DNV GL © 2014 DRAFT users/ August 22 2014 10
  • 11. Questions? SAFER, SMARTER, GREENER DNV GL © 2014 DRAFT August 22 2014 www.dnvgl.com 11