Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Im using Search Navigation web part to navigate to a search result page when user decides to do a scoped search. Im trying to pass all scoped search to the same search result page, instead of different search page per scope. When user click's on the item of the Search Navigation, SharePoint passes the search box keyword as query string parameter, which is expected:

/searchcenter/results.aspx?k=benefits

My question is, how to add another query string parameter that will identify the scope of my search and point to:

/searchcenter/results.aspx?k=benefits&q=scope1

When I update the Search Navigation item's url to point to:

/searchcenter/results.aspx?q=scope1

Then SharePoint creates the invalid URL with 2 question marks when user types a search and clicks on the item:

/searchcenter/results.aspx?q=scope1?k=benefits

Any ideas?

share|improve this question

2 Answers 2

We ran into this same issue. What we did was create a custom handler that knew which URLs to look for then re-route them. For instance, we would have URLs like:

http://intranet/search/scope1/_layouts/15/handlers/results.ashx?k=query

The handler reads the URL and knows where to take the token from and then we construct the same JSON object that search would when you use refinement panels.

Like you mentioned, trying any other way to tie another query into Search Navigation hasn't worked for us and resulted in double ? parameters which won't work.

share|improve this answer

Scopes are s=Your%20Scope and k as you have it is your term.

/searchcenter/results.aspx?s=scope1?k=benefits
share|improve this answer
    
Eric, i should have not used word "scope". What i meant is, pass a second parameter that will identify something for me, could be either scope, path, property, category etc that will be used as URLToken.ParameterName in the query text of the search web part on the search result page –  chris May 16 '13 at 18:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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