Posts

Showing posts with the label Search

SharePoint Online/2013 Replace no results default text ‘Nothing here matches your search’ from search results web part

Image
  As we all aware, SharePoint search have great potential to provide very powerful search solution. Couple of new webparts are added in SharePoint 2013, like Content Search web part for which I should use rather a word "Smart" search web part. With a new rendering mechanism, content search webpart becomes more and more simple to edit and customize. That mechanism is called "Display Templates" and these are based upon simple Json to HTML templates. I recently has faced a project scenario, where I was asked to replace the part of search result web part and I provided a solution by updating search display template. Requirement:   When we add a search result web part on any result page along with a search text box web part to enter search keywords. Search results will be displayed in web part if keyword matches any text. When we add both these web parts on page and before entering the search term also the results web part show  “Nothing here matches your search” (as sho...

Not able to view result while building Search Query

Image
Hello SharePointers ;), Here is another quick finding which I just thought should be shared to save someone precious time. If you are dealing with SharePoint 2013 search and Result sources, you must try to test the query template before saving it. If you are not able to see any results instead just a red error saying below text don't get scared I have quick solution for you. “The Search display templates are not present on this site collection. To add them, you need to activate the “Search Server Web Parts and Templates” feature on the Site Collection Features page. Display Error: The display template had an error. You can correct it by fixing the template or by changing the display template used in either the Web Part properties or Result Types. Template ‘~sitecollection/_Catalogs/masterpage/DisplayTemplates/System/Control_QueryBuilderPreview.js’ not found or has sytax errors. (Load Template: ) ” You must get frustrated because your search is properly configured, its crawling the ...

Get SharePoint search results using REST ajax call from Html

Image
Hi, We all aware the SharePoint exposed REST Api in order to perform various action at client side. There are some other ways also which a developer can adopt instead of REST(like CSOM) but that requires again client context. So it is recommenced that if we are using SharePoint Apps then use CSOM to get and update the data. Where as REST can be used in apps as well as some external applications. This blog is intended to show how user can utilize the REST api and get the SharePoint Search results. There are few pre-requisites or conditions which must be fulfilled before proceeding further. The machine where this code will be executed must have access to sharepoint site which means machine must be either in same domain or cross domain accessibility is there. Search must be configured at SharePoint server. Data must be properly crawled and you must get some results when searched for some keyword. Steps: 1) Open the Explorer or any desired location and create a text file with ant des...