ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Core Namespace / ArcGISPortalExtensions Class / SearchForContentAsync Method
The search parameters.

In This Topic
    SearchForContentAsync Method
    In This Topic
    Searches for portal items from a query string.
    Syntax

    Parameters

    portal
    queryParams
    The search parameters.

    Return Value

    Exceptions
    ExceptionDescription
    Thrown when an invalid portal is provided as the active portal.
    queryParams cannot be null.
    BoundingBox spatial reference must be WGS84.
    You do not have permissions to access this resource or perform this operation.
    Request failed: status code {status code}.
    Remarks

    This method returns a ArcGIS.Desktop.Core.Portal.PortalQueryResultSet<T> object that contains ArcGIS.Desktop.Core.Portal.PortalItem objects. Use the ArcGIS.Desktop.Core.Portal.PortalQueryResultSet<T>.Results property to get the collection of ArcGIS.Desktop.Core.Portal.PortalItem objects.

    You do not have to be a logged in user to search against the specified portal. However, an anonymous user will not be able to get information about items that have a ArcGIS.Desktop.Core.Portal.PortalAccess level of Private

    Comprehensive details on 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 may consider using for the ArcGIS.Desktop.Core.Portal.PortalQueryParameters.Query Property:

    To find one specific Item by it's Id: "id:00e5e70929e14055ab686df16c842ec1"
    To find all WebMap Items with the word 'florida' in the Title field: "title:florida AND type:web map"
    To find all Layer Package Items with the word 'florida' in the Title field: "title:florida AND type:layer package"
    To find all Items with the word 'florida' in any text field: "florida" (this results in 'q=florida')
    To find all Items with the word 'florida' in the Title field and the word 'esri' in the LicenseInfo field: "title:florida AND licenseinfo:esri"
    To find all Items with the word 'florida' in the Title field and not have the word 'esri' in the LicenseInfo field: "title:florida NOT licenseinfo:esri"
    To find all Items with located within a specific spatial extent and the word 'esri' in the LicenseInfo: "extent:[-114.3458, 21.7518] - [-73.125, 44.0658] AND licenseinfo:esri"
    To find all Items with a SpatialReference.WKID of 4267: "spatialreference:4267"
    To find all Items with a SpatialReference.WKID of 4267 or have the word 'usa' in the Title field: "spatialreference:4267 OR title:usa"

    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also