Search results and aliases...

Discussion created by norfolkwebdev on Jan 17, 2013
I'm working on displaying a set of search results. For our rural roads, they're often referred to with multiple names. So, with my search results, I would like to display them as the name that they searched for followed by the proper name.

For example, if a user searches for "Cherry", the result should come up as:
Cherry Valley Road (Concession 10)

I can execute the search fine, but having an issue displaying the results due to aliases that are set up (the GIS dept sets up the layer information for me).

Here is the object that gets returned:

displayFieldName: "ROAD_NAME"
feature: Object
  attributes: Object
     Alternate Name 1: "CHERRY VALLEY ROAD"
     Alternate Name 2: "<Null>"
     Alternate Name 3: "<Null>"
     County Hwy Number: "0"
     County Rd Number: "0"
     Former Name: "<Null>"
     OBJECTID: "2"
     Provincial Hwy Number: "0"
     Road Name: "CONCESSION 10 TOWNSEND"
     Shape: "Polyline"
   foundFieldName: "Alternate Name 1"
   geometryType: "esriGeometryPolyline"
   layerId: 27
   layerName: "Roads"

As you can see, the displayFieldName of ROAD_NAME doesn't match the field in the attributes ("Road Name"), which is the alias to ROAD_NAME.

I'm still new to the GIS world (I'm a programmer), and wondering what the best way would be to display the information as I'm looking to display it.