require(["esri/portal/PortalQueryParams"], (PortalQueryParams) => { /* code goes here */ });
import PortalQueryParams from "@arcgis/core/portal/PortalQueryParams.js";
esri/portal/PortalQueryParams
The parameters used to perform a query for Items, Groups, and Users within a Portal.
- See also
Constructors
-
Parameterproperties Objectoptional
See the properties for a list of all the properties that may be passed into the constructor.
Property Overview
Name | Type | Summary | Class |
---|---|---|---|
An array of categories stored within the item. | PortalQueryParams | ||
The name of the class. | Accessor | ||
Only relevant when querying for PortalItems. | PortalQueryParams | ||
Structured filter to use instead of the query property. | PortalQueryParams | ||
The maximum number of results to be included in the result set response. | PortalQueryParams | ||
The query string used for the search. | PortalQueryParams | ||
A comma-delimited list of fields to sort. | PortalQueryParams | ||
The order in which to sort the results. | PortalQueryParams | ||
The index of the first entry in the result set response. | PortalQueryParams |
Property Details
-
Since: ArcGIS Maps SDK for JavaScript 4.8PortalQueryParams since 4.0, categories added at 4.8. -
An array of categories stored within the item. Use this property to filter the results from Portal.queryItems() and PortalGroup.queryItems(). It accepts an array of:
- individual string elements or
- an array of strings.
The query looks at each element within the array and performs a SQL
AND
operation on them. If the element is an array instead of a single string element, the elements within this array are read asOR
. See the snippet below:Note: String[] elements are only supported by ArcGIS Online and version 10.6.1 of Portal for ArcGIS Enterprise.
Example// Query items with categories tagged as 'Basemaps' OR 'Imagery' AND 'People' OR 'Environment' // i.e. (Basemaps || Imagery) && (People || Environment) params.categories = [["Basemaps", "Imagery"], ["People", "Environment"]];
-
Only relevant when querying for PortalItems. When specified, restricts the results of the query to the extent defined here.
The spatial reference of the given extent must be WGS84 (wkid 4326) or Web Mercator (wkid 3857).
-
query
query String
-
The query string used for the search. View the ArcGIS REST API Search Reference for details on constructing a valid query.
- See also
-
sortField
sortField String
-
A comma-delimited list of fields to sort. Field names may vary depending on what is being queried. For example, the fields allowed for a user query are much more limited than if performing a basic search query for portal items. A list of possible field names is listed below. These names correspond to either item (search), group, and/or user queries.
Field name Query functionality title search, group uploaded search modified search username user created user, group type search owner search, group avg-rating search num-ratings search num-comments search num-views search Possible Values:"title" |"uploaded" |"modified" |"username" |"created" |"type" |"owner" |"avg-rating" |"num-ratings" |"num-comments" |"num-views"
-
sortOrder
sortOrder String
-
The order in which to sort the results.
Possible Value Description asc Sort the results in ascending order. desc Sort the results in descending order. Possible Values:"asc" |"desc"
- Default Value:asc
Method Overview
Name | Return Type | Summary | Class |
---|---|---|---|
Adds one or more handles which are to be tied to the lifecycle of the object. | Accessor | ||
Creates a deep clone of the instance of PortalQueryParams that calls this method. | PortalQueryParams | ||
Returns true if a named group of handles exist. | Accessor | ||
Removes a group of handles owned by the object. | Accessor |
Method Details
-
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25Accessor since 4.0, addHandles added at 4.25. -
Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.
// Manually manage handles const handle = reactiveUtils.when( () => !view.updating, () => { wkidSelect.disabled = false; }, { once: true } ); this.addHandles(handle); // Destroy the object this.destroy();
ParametershandleOrHandles WatchHandle|WatchHandle[]Handles marked for removal once the object is destroyed.
groupKey *optionalKey identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.
-
clone
clone(){PortalQueryParams}
-
Creates a deep clone of the instance of PortalQueryParams that calls this method.
ReturnsType Description PortalQueryParams A clone of the instance that called this method.
-
hasHandles
InheritedMethodhasHandles(groupKey){Boolean}
Inherited from AccessorSince: ArcGIS Maps SDK for JavaScript 4.25Accessor since 4.0, hasHandles added at 4.25. -
Returns true if a named group of handles exist.
ParametergroupKey *optionalA group key.
ReturnsType Description Boolean Returns true
if a named group of handles exist.Example// Remove a named group of handles if they exist. if (obj.hasHandles("watch-view-updates")) { obj.removeHandles("watch-view-updates"); }
-
Inherited from Accessor
Since: ArcGIS Maps SDK for JavaScript 4.25Accessor since 4.0, removeHandles added at 4.25. -
Removes a group of handles owned by the object.
ParametergroupKey *optionalA group key or an array or collection of group keys to remove.
Exampleobj.removeHandles(); // removes handles from default group obj.removeHandles("handle-group"); obj.removeHandles("other-handle-group");