Search

Description

This operation searches for content items in the portal. The searches are performed against a high performance index that indexes the most popular fields of an item. See the Search reference page for information on the fields and the syntax of the query.

The search index is updated whenever users add, update, or delete content. There can be a lag between the time that the content is updated and the time when it's reflected in the search results.

The results of a search only contain items that the user has permission to access.

Care should be taken when using ArcGIS REST API search operations (search, user search, group search) to find items, groups, and users programmatically. The Portal uses a powerful search engine to index information and to allow full text searching on it. This search engine uses many different inputs to find the appropriate results and rank them. This often makes search 'fuzzy', making it ideal for human interaction, but not necessarily ideal for looking for specific records programmatically. Developers should avoid using search to find specific items (e.g. by title) as the results of these types of queries might change as the search engine evolves.

Request Parameters

Parameter

Details

[Common Parameters]

For a complete listing, see Common parameters.

q

Description: The query string used to search. Search requires q, bbox, or both.

Advanced search options

Example: q=redlands+map

bbox

The bounding box for a spatial search defined as minx, miny, maxx, or maxy. Search requires q, bbox, or both.

Spatial search is an overlaps/intersects function of the query bbox and the extent of the document.

Documents that have no extent (e.g., mxds, 3dds, lyr) will not be found when doing a bbox search.

Document extent is assumed to be in the WGS84 geographic coordinate system.

Example: bbox=-118,32,-116,34

start

The number of the first entry in the result set response. The index number is 1-based.

The default value of start is 1 (that is, the first search result).

The start parameter, along with the num parameter, can be used to paginate the search results.

Example: start=11 (returns result #11 as the first entry in the response)

num

The maximum number of results to be included in the result set response.

The default value is 10, and the maximum allowed value is 100.

The start parameter, along with the num parameter, can be used to paginate the search results.

NoteNote:

The actual number of returned results may be less than num. This happens when the number of results remaining after start is less than num.

Example: num=50 (returns a max of 50 results in the response)

sortField

Field to sort by. You can also sort by multiple fields (comma separated) for items, sort field names are case-insensitive.

Supported sort field names are title, created, type, owner, modified, avgrating, numratings, numcomments, and numviews.

sortOrder

Description: Describes whether the results return in ascending or descending order. Default is ascending.

NoteNote:

This applies when working with sortField.

Values: asc | desc

Response Properties

Property

Details

query

The query string searched.

total

The total number of results found for the whole query. The number of query results is limited to 10000.

start

The number of the first entry in the result set for this response. The index number is 1-based.

num

The number of results included in the result set for this response.

nextStart

The next entry index if the current result set doesn't contain all results.

results

A JSON array of item objects. See the response properties of an item.

NoteNote:

ownerFolder, protected and commentsEnabled properties of an item are not included in search response.

Example Usage

URL for Search

http://www.arcgis.com/sharing/rest/search?q=park&f=pjson

JSON Response Syntax

{
  "query": "<query string>",
  "total": <total number of results>,
  "start": <results in first set>,
  "num": <number of results per page>,
  "nextStart": <result number of next page>,
  "results": [
    {
      "id": "<item id>",
      "owner": "<owner username>",
      "created": date created shown in UNIX time,
      "modified": date modified shown in UNIX time,
      "guid": "<unique id>",
      "name": "<item name>",
      "title": "<item title>",
      "type": "<type>",
      "typeKeywords": ["<keyword1>", "<keyword2>", "<keyword3>", "<keyword4>"],
      "description": "<description>",
      "tags": ["<tag1>", "<tag2>", "<tag3>"],
      "snippet": "<summary>",
      "thumbnail": "<file name>",
      "extent": [
        [minX, minY],
        [maxX, maxY]
      ],
      "spatialReference": "<coordinate system>",
      "accessInformation": <credits>,
      "licenseInfo": "<access and use constraints>",
      "culture": "<culture code>",
      "url": <URL>,
      "proxyFilter": {},
      "access": "private | shared |  org | public",
      "size": <size>,
      "properties": {},
		    "appCategories": [],
		    "industries": [<list of industries>],
		    "languages": [<list of languages>],
		    "largeThumbnail": "<URL to thumbnail>",
		    "banner": "<URL to banner>",
		    "screenshots": [<list of URL to screenshots>],
		    "listed": true | false,
      "numComments": <number of comments>,
      "numRatings": <number of ratings>,
      "avgRating": <average rating>,
      "numViews": <number of views>
    }
  ]
}

JSON Response Example

{
  "query": "park",
  "total": 11,
  "start": 5,
  "num": 2,
  "nextStart": 7,
  "results": [
    {
      "id": "eca787aacf9b4c0a8817f36276609db3",
      "owner": "test",
      "created": 1224884011000,
      "modified": 1474327423000,
      "guid": "{578DF0AF-660E-4735-9A83-D48395774CA2}",
      "name": "yellowstone national park",
      "title": "Forest resources within the study area.",
      "type": "MapDocument mxd",
      "typeKeywords": ["mxd", "map", "arcmap"],
      "description": "This map is intended to be used as part of the ArcCatalog Quick start tutorial.",
      "tags": ["Yellowstone National Park", "U.S.", "vegetation", "hydrology", "inlandWaters"],
      "snippet": "<b>Yellowstone National Park</b>",
      "thumbnail": "thumbnail/yellowstone_map.png",
      "extent": [ 
         [-110.05, 44.13], 
         [-110, 44.98] 
      ],        
	     "spatialReference": null,       
      "accessInformation": null,        
      "licenseInfo": "ArcEditor is a powerful GIS desktop system for editing and managing geographic data.",    
      "culture": "en-US",       
      "url": null,   
      "proxyFilter": null,     
      "access": "public",   
      "size": 105,
      "properties": null,
		    "appCategories": [],
		    "industries": [],
		    "languages": [],
		    "largeThumbnail": null,
		    "banner": null,
		    "screenshots": [],
		    "listed": false,            
      "numComments": 5,        
      "numRatings": 16,        
      "avgRating": 3.25,        
      "numViews": 169  
    },
    {
      "id": "28c343b688224d0ca1b5ba741c28de6e",
      "owner": "jsmith33",
      "created": 1263460602000,
      "modified": 1474327425000,
      "guid": "1D70DAC0-505A-463F-A948-B324FD18BE2A",
      "name": "National_Parks_in_the_Northwest",
      "title": "National Parks in the Northwest",
      "type": "Layer Package",
      "typeKeywords": ["Data", "Layer Package", "ArcMap", "ArcGlobe", "ArcGIS Explorer", "lpk"],
      "description": null,
      "tags": ["Parks"],
      "snippet": null,
      "thumbnail": "thumbnail/thumbnail.png",
      "extent": [
           [-130.098, 15.469],
           [-63.337, 54.048]
      ],
      "spatialReference": "GCS_North_American_1983",
      "accessInformation": null,
      "licenseInfo": null,
      "culture": "en-us",
      "url": null,
      "proxyFilter": null,
      "access": "public",
      "size": 612,
      "properties": null,
		    "appCategories": [],
		    "industries": [],
		    "languages": [],
		    "largeThumbnail": null,
		    "banner": null,
		    "screenshots": [],
		    "listed": false,
      "numComments": 1,
      "numRatings": 6,
      "avgRating": 3,
      "numViews": 86
    }
   ]
}

9/13/2017