ArcGIS Runtime SDK for WPF - Library Reference
SearchGroupsTaskAsync Method
See Also 
ESRI.ArcGIS.Client.Portal Namespace > ArcGISPortal Class : SearchGroupsTaskAsync Method

searchParameters
The search parameters.
Searchs groups from a query string.

Syntax

Visual Basic (Declaration) 
Public Function SearchGroupsTaskAsync( _
   ByVal searchParameters As SearchParameters _
) As Task(Of SearchResultInfo(Of ArcGISPortalGroup))

Remarks

This method obtains a Portal.SearchResultInfo<T> object that contains Portal.ArcGISPortalGroup objects. Use the Portal.SearchResultInfo<T>.Results Property to get the IEnumberable collection of Portal.ArcGISPortalGroup objects.

Portal.ArcGISPortalGroup objects are collections (aka. groups) of items, usually related to a specific area of interest such as maps (aka. WebMap), applications, and tools. Groups allow members to contribute items as a useful way to collaborate. The Portal.ArcGISPortal.SearchGroupsAsync Method allows searching for specific groups within ArcGIS Online (AGOL) or ArcGIS Portal. The Portal.ArcGISPortal.SearchGroupsAsync Method requires providing specific Portal.SearchParameters to limit the scope of which groups are returned.

You can call this method before calling the Portal.ArcGISPortal.InitializeTaskAsync Method and obtain Portal.ArcGISPortalGroup information BUT the Portal.ArcGISPortalGroup.ArcGISPortal Property will not be populated with valid information (i.e. its value will be Nothing/null). It is a recommended best practice to call the Portal.ArcGISPortal.InitializeAsync Method before calling the Portal.ArcGISPortal.SearchGroupsAsync Method so that all of the properties in the Portal.ArcGISPortal.ArcGISPortalGroup will contain valid data.

You do not have to be a logged in user using the IdentityManager to get information from the Portal.ArcGISPortal.SearchGroupsAsync Method. You can gain this information from anonymous access. However, to obtain information about groups in your organization that have a Portal.PortalAccess level of Private you need to use the IdentityManager by supplying the appropriate username/password credentials. As AGOL and ArcGIS Portal require the use of long term tokens to access secured information (i.e. information that is Private) you should remember to set the IdentityManager.TokenGenerationReferer Property to the correct string required by your development platform.

By default the Portal.SearchParameters.QueryString Property that is used in the Portal.ArcGISPortal.SearchGroupsAsync Method uses a default set of high performance index fields when providing simple keyword string(s) for the search. As of AGOL/ArcGIS Portal v2.1, these fields are: id, title, description, snippet, tags, and owner. For more advanced searches, developers can preface their simple keyword strings with a more exhaustive set of REST named fields followed by a colon (:). These advanced searches can also take advantage of Boolean operators (AND, NOT, OR, +), wildcard operators (* and ?), as well as other techniques to more fully utilize the AGOL/ArcGIS Portal search capabilities. Comprehensive details on using the advanced search strings that follow the REST specification can be found in the Search Reference document in the ArcGIS Portal API.

The following are a few advanced REST search scenarios with example strings that you might consider using for the Portal.SearchParameters.QueryString Property:

To find one specific ArcGISPortalGroup by it's Id: "id:1db70a32f5f84ea9a88f5f460f22557b"
To find all Private ArcGISPortalGroups with the word 'federal' in the Title field: "title:federal AND access:private"
To find all ArcGISPortalGroupds with the word 'federal' in the Title field and the word 'restricted' in the Description field: "title:federal AND description:restricted"
To find all ArcGISPortalGroups with the word 'state' in the Title field and not have the word 'restricted' in the Description field: "title:state NOT description:restricted"

NOTE: It is not required to use the advanced REST search syntax to find ArcGISPortalGroups with this Method. Simple string syntax for the Portal.SearchParameters.QueryString Property such as: "federal" will find all occurrences of that string in the default high performance index fields.

Parameters

searchParameters
The search parameters.

Requirements

Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows 7, Windows 8

See Also

© ESRI, Inc. All Rights Reserved.