On a SharePoint SearchResults page the core results webpart can be refined or filtered using the QueryString paramters 'r=' or 'a=' in the url. I am attempting to use the 'a=' parameter which works great for the fields 'format' and 'author' but I have no been able to get it to filter on Modified Date aka 'write' or on Site Url aka 'sitename'


 //queryString was "r=write%3D%22AQlQYXN0IFllYXIFd3JpdGUAFwFbMjAxMy0wNC0xMFQwMDowMDowMFo7XQ%3D%3D%22"
 //removing the urlEncoding %3D%22 you are left with the below value.

/*following decode written by http://stackoverflow.com/users/516910/broc-seib */
decodeBase64 = function(s) {
    var e={},i,b=0,c,x,l=0,a,r='',w=String.fromCharCode,L=s.length;
    var A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
    return r;

If you run the code above in your browser you will see the search was 'Past Year | write'. and it returned a few hundred results. How do I get this query to work using the 'a=' paramter ?


There was two issues, first I was always using the query format field="value" but that only matches exact values unlike field:"value", also depending the datatype not all values use quotes. Another issue is CustomFilters which mask the original value such as Past Year instead of passing -365..

For more on this visit the MSDN page which explains the syntax

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.