itemToSearchResult
Convert an IItem
to a IHubSearchResult
Fetches the enrichments, and attaches them as directed in the include
list
Parameters
Parameter | Type | Default | Notes |
---|---|---|---|
item Required | IItem | ||
includes Optional | string[] | [] | |
requestOptions Optional | IHubRequestOptions |
Available requestOptions
Property | Type | Notes |
---|---|---|
Optional | UserSession | |
Optional | string | |
Optional | boolean | |
Optional | IHubRequestOptionsPortalSelf | |
Optional Inherited | RequestCredentials | A string indicating whether credentials (cookies) will be sent with the request. Used internally for authentication workflows. |
Optional Inherited | function(input: RequestInfo, init: RequestInit) : Promise<Response> | The implementation of |
Optional Inherited | [key: string]: any | Additional Headers to pass into the request. |
Optional Inherited | boolean | Prevents the token from being passed in a URL Query param that is saved in browser history. Instead, the token will be passed in POST request body or through X-Esri-Authorization header. NOTE: This will force POST requests in browsers since auth header is not yet supported by preflight OPTIONS check with CORS. |
Optional Inherited | HTTPMethods | The HTTP method to send the request with. |
Optional Inherited | number | If the length of a GET request's URL exceeds |
Optional Inherited | IParams | Additional parameters to pass in the request. |
Optional Inherited | string | Base url for the portal you want to make the request to. Defaults to authentication.portal if authentication exists, otherwise to 'https://www.arcgis.com/sharing/rest'. |
Optional Inherited | boolean | Return the raw response |
Returns
Property | Type | Notes |
---|---|---|
AccessLevel | Access level of the backing entity | |
HubFamily | Hub Family | |
Inherited | Date | Date the entity was created |
Inherited | string | Source of the creation date as a property path
e.q |
Inherited | string | Id of the entity as a string |
Inherited | string | Name of the Entity For Entities backed by items, this is typically the title |
Inherited | string | For Item backed results, this will be |
Inherited | Date | Date when the entity was last updated Depending on the entity, this could be derived in many different ways |
Inherited | string | Source of the updated date |
Optional | string[] | Categories; Applies to Items |
Optional | IHubGeography | |
Optional | IHubLocation | Custom location defined on the item properties (item.properties.location), typically created in details pane of entity workspace. |
Optional | string | Owner; Applies to Items and Groups |
Optional | IItem | IGroup | IUser | IOgcItem | IChannel | IEvent | IRegistration | Raw result object returned from the search. This allows downstream processing to access additional properties that may not be explicitly defined in this interface Note: We will need to cast to the approproate type in order to access the properties |
Optional | string[] | Tags; Applies to Items |
Optional | string[] | TypeKeywords; Applies to Items |
Optional Inherited | IHubEntityLinks | Links to related things |
Optional Inherited | string | Source of the entity. Exact logic for this tbd, but the intent is to allow the result to be attributed to something other than "owner" |
Optional Inherited | string | Sanitized summary derived from item.snippet, item.description, group.description, user.description, event.description etc |
Function defined in common/src/search/_internal/portalSearchItems.ts:215