B U S I N E S S A N A L Y S T 10.2 R E S T B U S I N E S S E S S E A R C H U T I L I T Y
Select Businesses Endpoint
Returns business points matching the given search criteria.
Availability: Business Analyst Server.
http://localhost:6080/arcgis/rest/services/DefaultMap/MapServer/exts/BAServer/SelectBusinesses/execute
Specific Parameters
BusinessTypeFilters (optional) |
List of business type filters restricting the search. Type array of BusinessTypeFilter. |
FeaturesLimit (optional) |
The limit of returned business points. Type int. Default: 1000. |
MatchExactly (optional) |
True value of the parameter means the exact match of the string to search. Type boolean. Default: false. |
SearchString (optional) |
A string of characters which is used in the search query. Type string. |
SpatialFilter (optional) |
A spatial filter restricting the search. Type SpatialFilter. |
UseSimpleSearch (optional) |
True value of the parameter means a simple search (e.g., in company names only). Type boolean. Default: false. |
Other Parameters
ActiveDatasetID (optional) |
ID of the active dataset. Type string. Default: ID of the first available dataset. |
f (optional) |
Response format. Type string. Available formats: HTML, JSON, PJSON, XML. Default: HTML. |
IsFullErrorMessage (optional) |
Mode for composing error messages. Type boolean. Default: false. |
OutputSpatialReference (optional) |
An option specifying the spatial reference to return the output feature layer. Type SpatialReference. If this parameter is missing, the output record set will be returned in the default spatial reference. See Get Default Spatial Reference lookup operation to query the default spatial reference. |
ReturnGeometry (optional) |
An option specifying the presence of the shape attribute in the returned record set. Type boolean. Default: true. |
token |
Authentication token. This parameter is required if your Business Analyst Server is secured. Type string. |
Returns
Variable of type TaskResultOutput whose RecordSet parameter contains a feature record set containing geometry and attributes of the selected business points.
Remarks
Business points can be selected using any combination of three search criteria—a search string criterion, a spatial filter, and business type filters. A business point will be selected if it matches all search criteria specified.
The search string criterion is specified with the SearchString parameter. Its value is searched in textual attribute fields of a business point record using the following rules:
• For USA, the search is applied to the company name, North American Industry Classification System(NAICS) category name, and Standard Industrial Classification (SIC) category name of a business point.
• A business point record is considered to match the search string criterion if any of its search fields contains the SearchString parameter value as a word.
• If the SearchString parameter value contains a number of words delimited with spaces, a search field value is considered to match the search when all these words are found in it.
• A sequence of symbols enclosed in double quotes is a phrase. It is searched in search fields as a whole.
• The semicolon symbol ';' in the SearchString parameter value means logical OR operation, e.g. term1;term2;term3 mean search for term1 OR term2 OR term3.
• The symbol '*' in the SearchString parameter value is the wildcard. It means any number of arbitrary symbols.
• The wildcard should be a part of a word. It can be written in any place of word—at the beginning, at the end, or in the middle. A word can contain more than one wildcard.
• Don't use words consisting of wildcards only. In this case, the search results will be empty.
• Don't use uppercase AND and OR words in the search string. If you want to search for business points containing these words, use lowercase and/or.
• The search is case insensitive.
• If the MatchExactly option is true, the search fields are tested to contain the whole value of the SearchString parameter. This is the same as enclosing the whole search string in double quotes.
• If the UseSimpleSearch option is true, the search is restricted to the most important search field (the company name field for USA).
Fireproofing |
Searches for a single "FIREPROOFING" word. |
Burger King |
Searches for both "BURGER" and "KING" words. |
Burger;King |
Searches for "BURGER" or "KING" word. |
"Burger King" |
Searches for "BURGER KING" phrase. |
Don* |
Searches for a word starting with "DON". |
*Don |
Searches for a word ending with "DON". |
Don*ld |
Searches for a word starting with "DON" and ending with "LD". |
"Burger King";"Mc Donald" |
Searches for "BURGER KING" or "MC DONALD" phrase. |
The spatial filter is specified with the SpatialFilter parameter of the SpatialFilter type. It restricts the search in one of three possible ways—by specifying either an analysis extent, a boundary layer, or a list of business locations.
• If an analysis extent is specified, a business point located in this extent is considered to match the spatial filter.
• If a boundary layer with polygon geometry is specified, a business point belonging to any of the polygons of this layer is considered to match the spatial filter.
• If a list of business locations is specified, a business point, whose location fields are equal to one of the specified business locations, is considered to match the spatial filter. Business locations can be retreived with the Select Locations endpoint.
The business type filters are specified with the BusinessTypeFilters parameter. This parameter contains a list of business type filters of the BusinessTypeFilter type to be subsequently applied to selected business points. For USA, either the NAICS or SIC filter is useful as a business type filter. If both filters are specified in the BusinessTypeFilters parameter value, selected business points will match both of them.
Example Usage
The example below requests business points whose company name or NAICS/SIC category name contains the Fireproofing word. The search is restricted with the given list of address locations.
{ "results": [ { "paramName":"OutputFeatureClass", "dataType":"GPFeatureRecordSetLayer", "value": { "geometryType":"esriGeometryPoint", "spatialReference": { "wkid":4326 }, "fieldAliases": { "ObjectID":"ObjectID", "CONAME":"CONAME", "ADDR":"ADDR", "CITY16":"CITY16", "STATE":"STATE", "STATE_NAME":"STATE_NAME", "ZIP":"ZIP", "ZIP4":"ZIP4", "PHONE":"PHONE", "SIC":"SIC", "NAICS_EXT":"NAICS_EXT", "SALES_VOL":"SALES_VOL", "HDBRCH":"HDBRCH", "NUMBER_EMP":"NUMBER_EMP", "EMPSIZ":"EMPSIZ", "FRNCOD":"FRNCOD", "ISCODE":"ISCODE", "SQFT":"SQFT", "MATCH_CODE":"MATCH_CODE", "LOCNUM":"LOCNUM" }, "fields": [ { "name":"ObjectID", "type":"esriFieldTypeOID", "alias":"ObjectID" }, ... { "name":"LOCNUM", "type":"esriFieldTypeString", "alias":"LOCNUM", "length":9 } ], "features": [ { "geometry": { "x":-78.8841566368937, "y":42.9963874518871, "spatialReference": { "wkid":4326 } }, "attributes": { "ObjectID":1, "CONAME":"MARTIN FIREPROOFING CORP", "ADDR":"2200 MILITARY RD", "CITY16":"TONAWANDA", "STATE":"NY", "STATE_NAME":"New York", "ZIP":"14150", "ZIP4":"6006", "PHONE":"7166923680", "SIC":"262101", "NAICS_EXT":"32212103", "SALES_VOL":8040, "HDBRCH":"", "NUMBER_EMP":12, "EMPSIZ":"C", "FRNCOD":"", "ISCODE":"", "SQFT":"C", "MATCH_CODE":"MA100", "LOCNUM":"003513751" } }, ... { "geometry": { "x":-122.33431039378, "y":47.5556611381471, "spatialReference": { "wkid":4326 } }, "attributes": { "ObjectID":4, "CONAME":"A B CORLISS CO INC", "ADDR":"5201 1ST AVE S", "CITY16":"SEATTLE", "STATE":"WA", "STATE_NAME":"Washington", "ZIP":"98108", "ZIP4":"2205", "PHONE":"2067621660", "SIC":"289901", "NAICS_EXT":"32599811", "SALES_VOL":1647, "HDBRCH":"", "NUMBER_EMP":3, "EMPSIZ":"A", "FRNCOD":"", "ISCODE":"", "SQFT":"C", "MATCH_CODE":"MS100", "LOCNUM":"468915012" } } ] } } ], "messages": [ ] }
NOTE: The response has been abbreviated where "..." is noted.
See Also