Search Attributes task
The Search Attributes task allows a user to enter some text that will be used to search the attributes of the layers on the map. This kind of search is similar to the simple Web search that sites like Yahoo! and Google provide. After searching for something, the user can then select, zoom to, or pan to any features in the list of results.
Additionally, the Search Attributes task supports relates and stand-alone tables. Relates simply define a relationship between two tables without appending the associated data in each table. In many cases, the relates point toward stand-alone tables, which lack geometry but often contain valuable attribute information. For example, if you published a map service that contained relates between city parcels and a stand-alone table of parcel owners, you could utilize the Search Attributes task to display the owners and location of the parcel in the search results.
To configure the Search Attributes task, you'll need to specify the display settings, the search fields, and how you want the results to appear. You can do this on the Tasks panel by choosing your Search Attributes task from the list and clicking the Configure button.
Choosing the text to appear in the task
The General tab allows you to fine-tune the wording that users will see when they run your task. You can change the following:
- The name of the task. This name appears along the top bar of Web Mapping Application.
- The text of the button users will click to execute the task.
- The label text, which appears next to the search text box. You can phrase the label text any way you want to, such as "Search for rivers" or "Enter the last name of a parcel owner."
- A help tip that will display when a user pauses the pointer over the task.
Choosing what users will be able to search for
Use the Settings tab to determine which fields and layers in your map will be searchable. A list of the layers and fields in your map appears on the left. Choose which fields you want to be searchable and click the right arrow (>) button to move them to the list on the right.
The best fields for the Search Attributes task are usually nominal fields where most records have a unique value, for example, the name of the feature. When working with ordinal, interval, or ratio fields—for example, the average temperature or the cost of a feature—consider using the Query Attributes task instead.
When you select the layers and fields to search, if any of the layers share the same field name, that field will also be searched regardless of the layer you selected it with.
Choosing how results will be displayed
Use the Results tab to configure how task results will appear. It's helpful to know the following:
- You have the option to limit the number of results that are returned from a search. This can prevent the server from becoming unavailable if a search is made that would return an unreasonably large number of records.
- If you want your task to return a large number of results, be aware that ArcGIS Server map services limit the number of records returned by a query to 1,000. To change this default behavior, manually edit the configuration file and change the MaxRecordCount property. See the topic "Service configuration files" in the ArcGIS Server Help for more information.
- You can disable the default behaviors of grouping the results by layer and showing the attributes of the records returned by the search. You may want to test different settings to find which appearance best meets your needs.
- If you choose to enable MapTips, users can click result features to see an informational pop-up window. Result features will also be highlighted when users pause the pointer over them.
- You can change how the results appear on the Results panel and in the MapTips by choosing Custom formatting. When you do this, additional tabs appear that allow you to change the color of the result features, the information to be included, and the text format.