0

I need a way to let user dynamic query with several managed properties filters.

There is a page with two dropdown menu "FoodCategory" and "CookCategory". We have two managed properties in same name and setup as "refinable". Users can pick a value on these two dropdownmenu, type in some keyword and click search. It will redirect user to a URL like:

http://sp/results.aspx?k=keyword&FoodCategory=C01&CookCategory=C02 

It is fair easy to achieve in SP2010 but I don't know how to make it in SP2013.

When I click on the refinement panel, the URL will reflect the selection like:

{"k":"1","r":[{"n":"FoodCategory","t":["\"ǂǂ4c303130e9b699e7b8af\""],"o":"and","m":null,"k":false}]}

It seems my solution but there is a unique ID in the string. It makes the future maintenance and deployment very difficult.

Is SP2013 have OOB method for me search with querystring? If querystring is not feasible, any way I can make the page with two dropdownmenu work?

1

There is the Method

String queryString = Request.QueryString["search"];

If the url would be like .....search=45 this would return 45.

1

Hi Mark it's hard to find documentation for this but at the end I resolved using this pattern:

resultspage.aspx#Default={"k":"*","r":[{"n":"owstaxIdYourManagedProp","t":["cf32e33f-7ca2-470d-956b-29368e54e736"],"o":"OR","k":false,"m":{"cf32e33f-7ca2-470d-956b-29368e54e736":"TermName"}}]}

It's important to note that: k:* basically it means "all documents" owstaxIdXXX is a typical name of managed property mapped to a termset cf32e33f-7ca2-470d-956b-29368e54e736 is an example of termID inside your termstore TermName is an example of term name inside your termstore

  • Where did you find this method for using URL params in search? Also- you seem to reference the managed property, but you don't have any search terms used with it.. ie owstacxIdYourManagedProp:FordMustang – ferr Dec 18 '15 at 17:50
0

You could try the syntax "k=keyword ALL(FoodCategory:'C01' CookCategory:'C02')".

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.