I want to customize search query in site banner widget so that the DEFUALT search to be in the current group AND all its sub-groups.
I want to customize search query in site banner widget so that the DEFUALT search to be in the current group AND all its sub-groups.
You'll need to adjust the Site Banner's search.vm to load all of the sub-groups for the provided contextual group and populate the query for the search (instead of specifying a single ContainerId) with a search in the format:
[QUERY] and group:(GROUPID or GROUPID or GROUPID...)
Hi Ben,
but query is using ContainerId and contenttypeid as filter values and $core_v2_searchResult.List (https://community.telligent.com/community/10/w/api-documentation/60156/core_5f00_v2_5f00_searchresult-widget-extension ) didn't have option to add Groupid. Can please share bit of code how we can proceed over here
Correct. The query format is for the Query parameter and the single ContainerId parameter would need to be removed.
i changed the code like this
#elseif ($placeKey == 'group' && $type != 'groups')
##$searchQuery.Add("ContainerId", $placeValue)
#set($ggid=20)
$searchQuery.Add('group', $ggid)
#end
it showing all site results instead of goupid 20
Right -- there is no parameter named "group".
You'd need to specify it in the Query parameter:
#set($query = "$query AND group:($ggid)")
$searchQuery.Add('Query', $query)
Note that this will still only search a single group -- you'll need to use the API to load the full list of intended groups and specify it in the syntax I mentioned earlier.
Right -- there is no parameter named "group".
You'd need to specify it in the Query parameter:
#set($query = "$query AND group:($ggid)")
$searchQuery.Add('Query', $query)
Note that this will still only search a single group -- you'll need to use the API to load the full list of intended groups and specify it in the syntax I mentioned earlier.
Hi Ben , Thanks for that but there no luck.
Query formed as below but there no result it's returning blank
HybridDictionary]
group should be lowercase.
Thanks Ben, it worked like charm :)