Hi, Asser.
I've been able to reproduce this behavior both on ArcGIS Server 10.1 & 10.2.2.
For clarification: the underlying data source of the map service's layer is a FGDB, registered appropriately with ArcGIS Server (registeted under "Registered folders" under "Data store").
For example, I'm searching for the partial string "hel".
Here's what I'm getting in response to REST request with the "contains" parameter explicitly set to "true".
Request URL: http://[Map service REST URL]/MapServer/find?searchText=hel&contains=true&searchFields=&sr=&layers=2&layerDefs=&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&dynamicLayers=&returnZ=false&returnM=false&gdbVersion=&f=pjson
Response JSON:
{
"results": [
{
"layerId": 2,
"layerName": "Major lakes",
"displayFieldName": "name",
"foundFieldName": "name_abb",
"value": "L. Chelan",
"attributes": {
"OBJECTID": "1130",
"Shape": "Polygon",
"featurecla": "Reservoir",
"scalerank": "5",
"name": "Lake Chelan",
"name_abb": "L. Chelan",
"name_alt": " ",
"note": " ",
"delta": " ",
"dam_name": " ",
"year": "1927",
"admin": " ",
"DontShow": "0"
},
"geometryType": "esriGeometryPolygon",
"geometry": {
"rings": [
],
"spatialReference": {
"wkid": 102139,
"latestWkid": 3067
}
}
},
{
"layerId": 2,
"layerName": "Major lakes",
"displayFieldName": "name",
"foundFieldName": "name_abb",
"value": "Mitchell L.",
"attributes": {
"OBJECTID": "1188",
"Shape": "Polygon",
"featurecla": "Reservoir",
"scalerank": "9",
"name": "Mitchell Lake",
"name_abb": "Mitchell L.",
"name_alt": " ",
"note": " ",
"delta": " ",
"dam_name": " ",
"year": "-99",
"admin": " ",
"DontShow": "0"
},
"geometryType": "esriGeometryPolygon",
"geometry": {
"rings": [
],
"spatialReference": {
"wkid": 102139,
"latestWkid": 3067
}
}
}
]
}
From the above you can see, that with an explicit contains=true a partial "hel" string is correctly matched to full strings in underlying data: "L. Chelan", "Mitchell L."
According to documentation, the same URL with no contains parameter specified at all should produce the same results (since contains=true is assumed by default).
However, the following URL (same one as above, but with contains parameter omitted) returns no results whatsoever.
Request URL: http://[Map service REST URL]/MapServer/find?searchText=hel&searchFields=&sr=&layers=2&layerDefs=&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&dynamicLayers=&returnZ=false&returnM=false&gdbVersion=&f=pjson
Response JSON:
{
"results": [
]
}
So, I'm really lost here.
It seems, that when contains parameter is omitted from the REST's Find request URL => the value of false is actually assumed by default instead of true, and, consequently, only exact matches are performed.
Please, advise.
Alexander.