5

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

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

0

Or you can make your custom XSL Transformation. Go to Edit mode in Search-Results Page, edit Refinement panel open "XSL-Editor ..."

then there must be a part when the URLs a printed (usually with the css class: ms-searchref-filterLink. You could parse the URL parameter there and change the Link as needed. But you have to know XSL to do this propper, which is not my strength.

0

Yes, it is possible, with a custom refiner implementation.

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.