Esri / ArcREST

python package for REST API (AGS, AGOL, webmap JSON, etc..)
Apache License 2.0
192 stars 155 forks source link

Multiple types of items returned when searching the portal #260

Closed AlexArcPy closed 8 years ago

AlexArcPy commented 8 years ago

ArcRest

Version 3.5.4

Possible bug

When running the search() for the arcrest.manageorg.administration.Administration object, the t parameter is not respected (at least for me), and I get items of multiple types back in the results.

Repo Steps

agol_org_obj.search(q='MyRoutes', t='Feature Service') will return two items in the results key: one of Feature Service and another of File Geodatabase type. I am working towards an AGOL org.

AlexArcPy commented 8 years ago

It seems as the t parameter is not outlined in the REST help. Is it used in the first place?

achapkowski commented 8 years ago

@AlexArcPy - I'll take a look.

achapkowski commented 8 years ago

t is used.

Example:

admin = arcrest.manageorg.Administration(securityHandler=sh)
results = admin.search(q="map", t="content", focus="all", useSecurity=False)
AlexArcPy commented 8 years ago

OK, is there a list of types that are accepted? I was hoping to filter not just by "content" but rather by Feature Service, File Geodatabase etc.

achapkowski commented 8 years ago

@AlexArcPy So the search function mimics the search on the site page, not the search through the REST API. The focus, t, and other parameters are parameters that are shortcut parameters and may or may not work. When trying to pin down specific content types, like 'Feature Service', it is recommended that you use the guidelines outlined on the search help page: http://doc.arcgis.com/en/arcgis-online/reference/search.htm

AlexArcPy commented 8 years ago

Thanks, Andrew. Then I know that multiple types are returned not because of ArcREST, but rather because of AGOL search. Will try to work it out, but it seems as I am doing things right - searching with t='Feature Service'.

achapkowski commented 8 years ago

I think if you try: q="type: 'Feature Service'" it will work.

AlexArcPy commented 8 years ago

@achapkowski, you rock! agol_org_obj.search(q='''type: "Feature Service" title:"Routes" ''') does return just the feature service with this name. Thanks a ton!