Forum Discussion

María José Pedreira's avatar
María José Pedreira
Copper Contributor
May 22, 2017
Solved

URL for the Search results

I would like to solve 2 doubts about search in Sharepoint.


I have a page with three webparts: search box, search results and another one for refiners.


1) First doubt. I wonder if my url is right... After search for "spain" word my url is


http://mydomain/SearchSite/Pagines/results.aspx?k=spain


My next search uses the "europe" word and my url is:

http://mydomain/SearchSite/Pagines/results.aspx?k=spain#k=europe


I imagined something like that:


http://mydomain/SearchSite/Pagines/results.aspx?k=europe


The search is working fine and the results are correct but I wonder if there is something wrong about the url construction.


2) After several searches, the user clear words at the search box because he wants to show all the results. But the filter at the url doesnt change and the results are the same. Where do I have to order the reset for the last filters? (Adding a "Clear filters" link redirecting to the clear url is not a good solution for my design)

 

Thank you!

5 Replies

  • 1. This is expected as is uses async loading of subsequent searches. The only way to do this and keeping the term in the URL is by using the # parameter. By appending # params you can modify the URL without the whole page re-loading.

    2. Search solutions typically don't have a "clear" term. You remove them, and type something else. This resets all filters as well.

    So, ignore the URL - it's just state, and how MS decided to implement async loading as well as being able to copy/paste links that work with the right query.
    • María José Pedreira's avatar
      María José Pedreira
      Copper Contributor

      Hi Mikael,

       

      About point 1) ok, thank you for the information.

      About point 2), for an advanced user I think there is no problem because its easy to remove filters and try a new query. But in the case of a not advanced users, they'll think that the search is working wrong... In that case, what is your suggestion... Create a link for "Clear results"? Is that the best solution?

       

      Thank you

Resources