Forum Discussion
Jesper Torp Lassen
Oct 23, 2018Copper Contributor
Result page for Search box
Hi there, I hope someone can help me. I need to build a simple search, where what ever is typed in search box, is just entered as-is after the results page URL i have set. So i have a results pa...
spucelik
Microsoft
Oct 23, 2018Jesper...you can accomplish this with a Content Search web part and the KQL query provided. Here are the steps I used to repro the solution:
- Create a new Web Part Page.
- Add the Search Box and Content Search web parts to the page.
- Make sure the Search Box results are pointing to the Content Search web part. It should do this automatically.
- In the properties of the Content Search web part -> Change Query button -> Advanced View to see the KQL editor.
- Paste in this KQL: "path: http://....../.../search/{SearchBoxQuery}"
- Save and test.
Assumptions:
- When the user types in something in search box, whatever they type in will get appended to the end of the "path" url in the KQL search string.
- In my testing whatever I typed in the search box was a site that I wanted to focus my search to.
- In your example I assumed amsterdam was the name of a site you wanted to focus your search results to.
- The Content Search web part will return results specific to the "path" in the KQL query.
Hopefully this is what you're looking for.
Steve
- Jesper Torp LassenOct 24, 2018Copper Contributor
Hi Steve :-)
Thanks very much for this, but it didnt quite help me, and that might be my fault not explaining correctly. I would like the result to be the browser opening a new page, with URL build by the URL+{search box input}