I have a list with some fields. I want to create a search page for that List in which every keyword matching the data for any list item will be returned. How can I search content in SharePoint List using CAML query in JSOM.
1 Answer
Since your site is a Publishing Web
, the best approach will be to use SharePoint's OOB Content By Search Web Part
. These CSWP
can be placed on your page.
How the Content Search Web Part works
Content Search Web Part displays search results in a way that you can easily format. Each Content Search Web Part is associated with a search query and shows the results for that search query.
You can use display templates to change how search results appear on the page. Display templates are snippets of HTML and JavaScript that render the information returned by SharePoint. The information to be displayed gets inserted into the page in JSON format.
If you are unaware of CSWP
then read Configure a Content Search Web Part in SharePoint and Using the Content Search web part (and understanding SP2013 search)
content search web part
instead writing code.Content search webpart
is provided by SharePoint OOB. It is used to display data from the query supplied by user. And that supplying of query can be from a search box as you need in your case. I dont think so you need aContent Editor Web Part
.