{"id":2587,"date":"2013-04-03T21:08:02","date_gmt":"2013-04-03T21:08:02","guid":{"rendered":"https:\/\/www.wapshere.com\/missmiis\/?p=2587"},"modified":"2013-04-03T21:08:02","modified_gmt":"2013-04-03T21:08:02","slug":"workaround-for-search-scope-advanced-filter-empty-search-string-problem","status":"publish","type":"post","link":"https:\/\/www.wapshere.com\/missmiis\/workaround-for-search-scope-advanced-filter-empty-search-string-problem","title":{"rendered":"Workaround for Search Scope Advanced Filter empty search string problem"},"content":{"rendered":"<p>R2 made a <a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/jj134313(v=ws.10).aspx\">change to search scopes<\/a>\u00c2\u00a0that I wasn&#8217;t particularly happy with &#8211; in fact as far as I&#8217;m concerned they broke search. The Advanced Filter was offered as a way to restore old functionality, however that introduced two new bugs &#8211; clicking search with nothing in the search box returned nothing (listed <a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/hh322889(v=ws.10).aspx\">here<\/a> as a known problem) and\u00c2\u00a0\u00c2\u00a0clicking Advanced Search with nothing in the search box gives you a bunch of unusable filters you have to delete.<\/p>\n<div><!--more-->I&#8217;ve been watching out for a fix for these problems and haven&#8217;t seen one (except in an early R2 hotfix that got recalled, so doesn&#8217;t count). Finally I asked my customer to open a PSS call and we were given a workaround that actually does solve the first problem.<\/div>\n<div id=\"main-content\">\n<p>Instead of setting the Advanced Filter like this (as per the documentation):<\/p>\n<pre>\/ManagementPolicyRule[contains(DisplayName, '%SEARCH_TERM_STRING%')]<\/pre>\n<p>you set it like this:<\/p>\n<pre>\/ManagementPolicyRule[starts-with(DisplayName, '%%SEARCH_TERM_STRING%')]<\/pre>\n<p>Note there is a double % there. We are basically using the first % as a wildcard, giving us a &#8220;contains&#8221; functionality. An empty string is now effectively a wildcard, giving us all objects as we would expect.<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>R2 made a change to search scopes\u00c2\u00a0that I wasn&#8217;t particularly happy with &#8211; in fact as far as I&#8217;m concerned they broke search. The Advanced Filter was offered as a way to restore old functionality, however that introduced two new bugs &#8211; clicking search with nothing in the search box returned nothing (listed here as&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":[]},"categories":[60,63],"tags":[],"class_list":["post-2587","post","type-post","status-publish","format-standard","hentry","category-fim-2010-r2","category-search-scopes"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pkp1o-FJ","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/2587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/comments?post=2587"}],"version-history":[{"count":1,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/2587\/revisions"}],"predecessor-version":[{"id":2588,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/posts\/2587\/revisions\/2588"}],"wp:attachment":[{"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/media?parent=2587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/categories?post=2587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wapshere.com\/missmiis\/wp-json\/wp\/v2\/tags?post=2587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}