- URL:https://[root]/search/suggest
Example usage
URL for Suggest
https://www.arcgis.com/sharing/rest/search/suggest?f=pjson&suggest=population
Description
The suggest operation provides user with a list of suggested related results as they type character-by-character into the query. It helps user discover instant items related to their query simultaneously as they type, reduce the amount of characters one needs to enter before executing a full search and facilitate the overall interactive search experience.
The results of a suggest only contain items that the user has permission to access.
Request Parameters
Parameter | Details |
---|---|
[Common Parameters] | For a complete listing, see Common Parameters. |
suggest | The query string to search. Note:The engine tries to match the query to partial terms of item fields such as title, tags, categories, owner and suggests the most relevant result items. Advanced query syntax like field specifications, range queries, wildcard search, boolean operators, boosting a term or grouping are not supported in this parameter. String size limit is 409 characters. Example: population |
filter | Structured filtering through specifying field name followed by a colon and the term you are looking for with double quotation marks. It is designed to allow passing in application level filters based on its context. Specified field value should be an exact keyword match of the value interested, partially match the filter keyword will fail the matching and not return meaningful results. Filter string should be less than 3681 characters. Example:
|
searchFields | A comma separated list of item fields that will be used to look up for matching given a query string. By default, all fields below are used. Supported values: title, tags, categories, owner, type, typekeywords Example: title (only look up item titles when trying to match a query string) |
returnFields | A comma separated list of item fields to be included in the result set response. By default, all fields are returned. Supported values: id, title, tags, categories, owner, type, typekeywords |
max | The maximum number of results to be included in the result set response. The default is 5, maximum allowed is 10. |
Response Properties
Property | Details |
---|---|
suggest | The query string. |
total | The total number of items in result set response. |
results | A JSON array of item objects, the detailed properties of which are listed below. |
Result Item Properties
Property | Details |
---|---|
owner | The item owner. |
id | The item ID. |
categories | An array of the item's content categories if available. |
type | The type of the item. |
title | The title of the item. |
tags | An array of the item tags. |
typeKeywords | An array of the item type keywords. |
JSON Response Syntax
{
"total": < total num of results>,
"suggest": "<query string>",
"results": [
{
"<suggested result item 1>"
},
{
"<suggested result item 2>"
},
{
"<suggested result item 3>"
},
{
"<suggested result item 4>"
},
{
"<suggested result item 5>"
}]
}
JSON Response Example
{
"total": 5,
"suggest": "population",
"results": [
{
"owner": "Columbia",
"id": "6e4a2f8cf7564fa499e58a4a87e6c7f1",
"title": "Gridded Population of the World (GPWv4) UN-Adjusted Population Density 2015",
"type": "Web Map",
"tags": [
"GPW",
"Population Density",
"population",
"housing",
"demographics",
"people",
"urban"
],
"typeKeywords": [
"ArcGIS Online",
"Explorer Web Map",
"Map",
"Online Map",
"Web Map"
]
},
{
"owner": "esri",
"id": "f42926b976064414ac0d03ae51aa4f2e",
"type": "Image Service",
"title": "World Population Estimate",
"tags": [
"landscape6",
"landscape",
"disturbance",
"hazards",
"demographics",
"esri_landscape"
],
"typeKeywords": [
"ArcGIS Server",
"Data",
"Image Service",
"Requires Subscription",
"Service",
"Singlelayer"
]
},
{
"owner": "MTDOC_DOC",
"id": "c51a7e7d5f1449bba2be84f6a4cd7b6c",
"title": "Veteran Population by County - 2013 Population Projections",
"type": "Web Map",
"tags": [
"CEIC",
"County",
"Department of Commerce",
"Montana",
"Montana Census Economic Information Center",
"Montana Department of Commerce",
"Veteran",
"Population"
],
"typeKeywords": [
"ArcGIS Online",
"Explorer Web Map",
"Map",
"Online Map",
"Web Map"
]
},
{
"owner": "AtlasPublisher",
"id": "0fd7dc7c53c34b03ab4475d895b5d32f",
"type": "Map Service",
"title": "Predominant Population",
"tags": [
"USA",
"population",
"predominant population",
"race",
"ethnicity",
"demographics",
"census",
"census bureau",
"county",
"tract"
],
"typeKeywords": [
"ArcGIS Server",
"Data",
"Map Service",
"Service"
]
},
{
"owner": "esri",
"id": "42fc3a7efb914256b4e4707bd1b00847",
"type": "Map Service",
"title": "2018-2023 USA Population Growth",
"tags": [
"USA",
"US",
"United States",
"North America",
"demographics",
"US Census Bureau",
"US Department of Commerce",
"DOC",
"census",
"KeyUSFacts",
"Key Facts",
"KeyFacts",
"population",
"age",
"family",
"block groups",
"tracts",
"counties",
"states",
"population change",
"predicted growth",
"growth",
"growth rate",
"rate",
"percent change",
"population growth",
"2010 Census",
"demographics8",
"Base"
],
"typeKeywords": [
"ArcGIS Server",
"Data",
"Map Service",
"Requires Credits",
"Service"
]
}
]
}