-->

Wednesday, 21 March 2012

Encode and Decode Refiner value from the Query URL

I hope you liked my previous post on "Adding Filter in the Refinement Panel of the Search Page". I was exploring more about how the Refinement works and I found out then whenever we hover over each filter on the refiner it shows the url value to be encoded.


Something like this,
https://search.com/pages/peopleresults.aspx?k=*&r=dttsource%3D%22AQpVUzpEU3RyZWV0CWR0dHNvdXJjZQEBIgEi%22


if we decode the above url, we will get something like this
https://search.com/pages/peopleresults.aspx?k=*&r=dttsource="AQpVUzpEU3RyZWV0CWR0dHNvdXJjZQEBIgEi"

k=* specifies that i have performed the Keyword search for "*", i.e wildcard search
r=dttsource="AQpVUzpEU3RyZWV0CWR0dHNvdXJjZQEBIgEi" specifies that the list of fiters we have applied

Here i cannot know which filter I actually applied. Also it was difficult to understand how the refinement panel constructs the query string by combination of the multiple filters.
But it's very important for me to know which filter I applied, So i developed a small utility which will encode as well as decode the refiner value.

Decode Refiner Value from Query URL


Encode the Refiner Value from the filter name and column value


You can download both the utility from here

Note: For some OS/Browsers you might have to rename the files to .exe extension

I hope this post and utility was useful to you.

Thank you. Happy Sharepointing !

6 comments:

  1. This is fantastic thanks! Question: will it be possible to release the codes for encoding. I need to do it through C#! :)

    ReplyDelete
  2. Thanks Augustus!
    Yes i will try to upload the source code pretty soon.

    Regards,
    Kalashnikov
    http://kalashnikovtechnoblogs.blogspot.in

    ReplyDelete
  3. I have uploaded the code for encoding at the below location

    https://skydrive.live.com/redir.aspx?cid=4e439d603972cb25&resid=4E439D603972CB25!116&parid=4E439D603972CB25!113

    Regards,
    Kalashnikov
    http://kalashnikovtechnoblogs.blogspot.in

    ReplyDelete
  4. Love it. Is it too much to ask for the source codes in the decoding as well? ;)
    Thanks

    ReplyDelete
  5. Hi Dhaval,
    Would you be so kind to upload the decode sources as well?
    Thanks!
    Alex

    ReplyDelete