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

Is there any way to change the way refinement query URLs are built so that they use "contains" operation (":") rather than "equals" ("=")?

Scenario:

a) Document A - tagged with Sector = Retail

b) Document B - tagged with Sector = Retail and Energy

c) A search refinement exists for the Sector property.

When I clicking on "Sector : Retail" refinement only Document A is displayed. Document B won't show.

Problem:

When refining my search results by "Sector: Retail" I would expect all items tagged with "Retail" to show up. Not only items tagged with "Sector: Retail" but also tagged with more than one sector (e.g. "Sector : Retail; Energy, Construction")

Cause:

By default when clicking on a search refinement the page is reloaded with a new url that uses an "equals" operation ("=") rather than "contains" (":")

E.g. clicking on a "Sectors: Retail" refinement:

Encoded URL: /Search/Pages/results.aspx?r=sectors%3D%22Retail%22

Decoded URL: /Search/Pages/results.aspx?k=report&r=sectors="Retail"

This will display items that have the "Sectors" field set to "Retail" only.

However, items that have the "Sectors" field set to more than one option (e.g. "Retail" and "Energy") will not be displayed.

Goal:

If I change the URL to use a "contains" operator (":") all items that are tagged with Retail (or Retail and another sector) are displayed fine.

e.g. /Search/Pages/results.aspx?k=report&r=sectors:"Retail"

Is there any way to change the way refinement query URLs are built so that they use "contains" instead of "equals"?

Related info:

http://sharethelearning.blogspot.co.uk/2011/06/refinement-filtering-in-sharepoint.html

http://social.msdn.microsoft.com/Forums/pl/sharepoint2010general/thread/4a4c54e4-a2ee-40b3-b979-63433d241790

share|improve this question

1 Answer 1

I can't see a way of doing that with the out-of-box functionality. However, you could write your own refinement filter generator. Essentially, it's about subclassing RefinementFilterGenerator

share|improve this answer

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.