Search widget modifications

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.

Parents Reply Children
  • 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.

  • Hi Ben , Thanks for that but there no luck.

    Query formed as below but there no result it's returning blank 

    HybridDictionary]

    • "PageSize": 10 [Int32]
    • "PageIndex": 0 [Int32]
    • "Collapse": "True" [String]
    • "Query": "test AND Group:(20 or 14)" [String]
    • "Filters": "contenttypeid::(0a236e15-36ee-4c88-acb0-71dc49191720 OR 56f1a3ec-14bb-45c6-949f-ee7776d68c78 OR f7d226ab-d59f-475c-9d22-4a79e3f0ec07 OR 07eef79e-7081-4fd2-b548-6cddd02e66b1 OR 46448885-d0e6-4133-bbfb-f0cd7b0fd6f7 OR f586769b-0822-468a-b7f3-a94d480ed9b0 OR fb5d84b1-0a57-4544-8a7a-45dafc1faa43 OR 08ca0da0-e017-4a80-9832-476c74d4f174 OR df237622-6cc3-4fc2-8555-ef4fb2656444 OR f1feaab6-85f7-463a-a529-fc2abebc9bca OR 858a2037-b76c-4898-9365-125879b49843 OR bda1b85b-d6a0-42dc-84e5-9daf1ea18fa3 OR 68c65af2-aa15-4e4c-9c81-155c6a3159f6 OR 9262536b-49a3-4494-802f-04dff10424ed OR b0059de4-df5f-4e74-994a-d9df10019867 OR 6b577b8c-0470-4e20-9d29-b6772bf67243)" [String]
    • Count: 5 [Int32]
    • IsFixedSize: False [Boolean]
    • IsReadOnly: False [Boolean]
    • IsSynchronized: False [Boolean]
    • Keys [ICollection]
      • [0]: "PageSize" [String]
      • [1]: "PageIndex" [String]
      • [2]: "Collapse" [String]
      • [3]: "Query" [String]
      • [4]: "Filters" [String]
    • SyncRoot [Object]
      • "PageSize": 10 [Int32]
      • "PageIndex": 0 [Int32]
      • "Collapse": "True" [String]
      • "Query": "test AND Group:(20 or 14)" [String]
      • "Filters": "contenttypeid::(0a236e15-36ee-4c88-acb0-71dc49191720 OR 56f1a3ec-14bb-45c6-949f-ee7776d68c78 OR f7d226ab-d59f-475c-9d22-4a79e3f0ec07 OR 07eef79e-7081-4fd2-b548-6cddd02e66b1 OR 46448885-d0e6-4133-bbfb-f0cd7b0fd6f7 OR f586769b-0822-468a-b7f3-a94d480ed9b0 OR fb5d84b1-0a57-4544-8a7a-45dafc1faa43 OR 08ca0da0-e017-4a80-9832-476c74d4f174 OR df237622-6cc3-4fc2-8555-ef4fb2656444 OR f1feaab6-85f7-463a-a529-fc2abebc9bca OR 858a2037-b76c-4898-9365-125879b49843 OR bda1b85b-d6a0-42dc-84e5-9daf1ea18fa3 OR 68c65af2-aa15-4e4c-9c81-155c6a3159f6 OR 9262536b-49a3-4494-802f-04dff10424ed OR b0059de4-df5f-4e74-994a-d9df10019867 OR 6b577b8c-0470-4e20-9d29-b6772bf67243)" [String]
      • Count: 5 [Int32]
      • IsFixedSize: False [Boolean]
      • IsReadOnly: False [Boolean]
      • IsSynchronized: False [Boolean]
      • Keys [ICollection]
        • [0] [String]
        • [1] [String]
        • [2] [String]
        • [3] [String]
        • [4] [String]