2

I have a question from a customer for search results in SharePoint 2013 on premise.

When a user insert a search query in the search box, this 'search word' is automatically added to the URL (for example: "results.aspx?k=word")

When the user inserts a new query, or will choose another search navigation item (for example 'People') this keyword is still in the url. So if he afterwards search for a second word, the URL become like "/results.aspx?k=word#k=second"

Is there a way or setting to avoid this? So when the user deletes the keyword in the search box, or just insert a new one, the url will also be adjusted?

If need any more information, just let me know.

Thanks in advance!

  • What is the reasoning behind trying to change this default behaviour? The behaviour is part of MDS – Robert Lindgren Apr 17 '14 at 10:19
  • this is because the switch between the search scopes (documents and people). If they insert a query keyword (for example "acquires") and they click on "People" afterwards, this term is automatically executed on the 'People' scope instead of give the user the permission to insert a new query. – deefken Apr 17 '14 at 10:59
  • This is the default behavior. The idea is to make it easier on the user, they can skip from search vertical to search vertical without having to type in the same search term for each vertical. All your users have to do is replace the contents of the search box. – Matthew McDermott Apr 18 '14 at 12:09
0

The reason for this is that everything after # is picked up and executed using ajax/async. The part between ? and # has to remain the same for ajax to work.

For the page itself it will disregard the original query as the k parameter after the hash takes precedense.

So, can you strip it? Sure, if you override the script on the page...but the cost is that ajax calls will not work and you Get a full page refresh.

Personally I would ignore it as it is of no consequence to the end user.

| improve this answer | |
0

As all calls on the 2013 search page is done using AJAX, the real query is added to the hash part of the url, the part coming after the # character. If you want to clear all filters and the search terms, then you can add what designers call a dummy link with a # to the page, and that will reset your query.

Ref Link : Clear Filters

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.