In this topic
  1. Configuring the Enhanced Search widget
  2. Using the Enhanced Search widget
    1. By Attribute
    2. By Shape
    3. By Spatial
    4. Results
    5. URL Search
  3. What's New

Enhanced Search Widget Version 2.11

The Enhanced Search widget allows you to retrieve information from source data by executing a predefined query(s).

The Enhanced Search widget serves as a query builder during configuration, allowing you to define the query by specifying the map service layer url, filter expression, and displaying fields in query results. Each Search works with a single layer. However, you can define multiple searches for a single application, and data layers can be from multiple sources.

Configuring the Enhanced Search widget

The following steps indicate how to create a search. Repeat these steps if you need to define multiple searches.

  1. Hover the mouse over the Enhanced Search widget and click the small edit icon Edit

    The configuration window for this widget opens.

    Add new search
  2. Optionally, click change widget icon if you want to replace the default icon for this widget.

    A file explorer window opens allowing you to browse to a local image file to use as the widget icon.

  3. Click Add a Search Layer under Settings.

    The new search dialog opens. Now enter the Search URL of the service layer that you wish to use in the search.

    Search URL

    Once you have entered the url, click into the next field or press enter in order to load the layers fields into the Available Fields grid.

    URL Browse Button
    Available Fields
  4. Select individual fields from the Available Fields grid and click the Include button or just click the Include All button to add all the available fields to the Included Fields grid.
  5. Next choose one of the fields to be the Title field by selecting the radio button for that field.

    Choose title field
    Format field
  6. Optionally set Result Item Sorting by clicking the pencil.

    Result Sorting

    This will bring up this dialog to allow you to add fields and choose the sort direction.

    Result Sorting Dialog
  7. Give your search a Title.
  8. Optionally enter a Definition Expression.

    The Definition Expression is a string that will validate to an actual SQL expression (i.e. Upper(Field_Name) = 'ROBERTS').

    • For example:
    • • You might want to search only cities with a population above a certain threshold.
    • • Many datasets, such as roads and street datasets, have subsets of features (classes), and you might want to define search layers for each class of roads independent of the other features..
    • • In another case, you might have large enterprise databases with datasets that contain millions of features across wide extents—say for a whole nation or state. Yet, in your search, you might want to work with only a subset of that data.

  9. Optionally check the Spatial Search Layer checkbox if you want to alow this layer to be included in a spatial search.
  10. Optionally select the Layer Symbology option you want the layer to have. The default is from Server which means that the layer symbology will be drawn from The ArcGIS Server map services symbology. from Config means that the widgets default symbology for the geometry tupe will be used. from Layer means that the search results for this specific layer will be drawn using the symbology specified by the layers symbology configration. To add or edit that layer specific symbology just click on the Add\Edit Layer Specific Symoblogy button.
  11. Optionally set the Zoom scale if only set the zoom scale then this will only apply to point geometry results, but if you also chack the Force Scale then the zoom scale will be used on all geometry types.
  12. Optionally select the Add result as opertional layer if you want the layer to appear in the Layer List Widget and/or Attribute Table Widget
  13. Optionally select the Show in Attribute Table Widget if you want the search results to automatically open in the Attribute Table Widget.
  14. Optionally select the Auto zoom to search results and/or Disable search results popup if you want to override the widgets global settings for these option for this layer only.
  15. Optionally select the Show Attachments if you want the search results popup info window to have a link to the features attachments.
  16. Optionally select the Hide Null data in widget results and popups if you want the search results and popups to not contain any fields that have no data.
  17. Optionally add search link(s) to your search by clicking the Add Link button.
    Add Link

    Give the link an alias and configure the other link options like Disable Link if Null which will prevent the link from showing in the widget if the link field is null, and Disable link in PopUp (self-explanatory), and PopUp Link Type which assigns the link as a text hyperlink in the popup or and image link.

    Set the Link Content by assigning static text that represents the link url (i.e. http://www.esri.com) or clicking the Plus button to add a field from the search layer that contains the link url. Do the same for the Link Icon Content.

  18. Optionally add search relate(s) to your search by clicking the Add Relate link.
    Add Relate

    Give the Relate an alias and add the fields you want to appear in the results.

    Select individual fields from the Available Fields grid and click the Include button or just click the Include All button to add all the available fields to the Included Fields grid.

    Choose fields
    Format field
  19. Click Add Expression to display the individual expression dialog.
    Expressions

    Enter an Expression Alias and a Search Label

    Next click the Add Expression Value to display the expression value builder.

    Expression Value
  20. Select a search field, an operation, and provide a value in the text box. Optionally, check the Unique option to list all unique values for the selected field in the data layer. This option is handy when your selected field is a string or number. You can also use the Predefined option that allows you at build a list of predefined values for the user to choose from (option only available if Ask for values is checked).
    Select Unique option
    You can check the Value is required to be entered to enable search option and this will force the use of this expression value. If this option is not checked and the user does not enter a value, then this portion of the expression will not be used in the final SQL that is submitted to the server.
    You can also use the Predefined option that allows you at build a list of predefined values for the user to choose from.
    Select Predefined option
    Click the Add List Value button to add a row to the Predefined Value(s) grid. To add the text to the new row that was created, double click the row and enter your predefined value into the textbox.

    If you are searching a date range is between or is not between then you can specify that the start date (by default the current date) have a defined number of days subtracted from it. By checking the Start Date is current date minus and entering a number of days the date range can be set to be a certain date span (i.e the last 30 days).
    Date span
  21. Optionally, check Ask for values.
    When this option is checked, your input value is the default query value and you have the choice of providing a new value to overwrite the default value at run time.
  22. Click OK to complete the adding the expression value step.

    If you choose to add more than one expression value then subsequent adds will have a new option on the dialog. At the top of the dialog you will find text and a drop down choice. Depending on if All or Any of the values in the defined expression are true, either records meeting all the values or records meeting any of the values in the expression are returned in the results.
    Subsequent Expression Value
  23. Click OK to complete the adding the expressions step.
  24. Click OK to complete the adding the search layer step.
  25. Click OK to complete the adding the search step.
  26. Optionally, click the Edit General Settings.
    General Widget Options
  27. Optionally, click the Edit Default Search Symbology.

    The default symbology dialog opens, allowing you to choose the color and style for the search result symbol if the map service to not return this information.

    Select symbol in results setting
  28. Optionally, click the Edit Default Buffer Properties.

    The default buffer properties dialog opens, allowing you to choose the color and style for the buffer symbol, the buffer units, the WKID of the buffer, the default buffer distance, and whether the buffer layer is added to the legend (and thus print output).

    Buffer Unit Properties
  29. Optionally, click the Edit Spatial Search Properties.

    The spatial search properties dialog opens, allowing you to choose from a list of available spatial search operations that will be made available to the user in the widget.

    Spatial Search Properties
  30. Optionally, click the Edit Graphical Search Options.

    The graphical search options dialog opens, allowing you to choose from a list of available graphical search drawing tools that will be made available to the user in the widget.

    Graphical Search Options
  31. Optionally, click the Edit Disabled Tab(s).

    The disabled tab(s) dialog opens, allowing you to choose from a list of tabs that you want to disable to the user in the widget.

    Disabled Tabs
  32. Optionally, you can customize the No results text that is displayed by editing the noResults property of the widgets nls/strings.js file to add additional instructions/HTML text or links.
    This is beneficial when you need to provide further guidance to the end user on what to do if their search does not produce any results. See the blow example and result.
    No Results
  33. Optionally, click the Edit Result Formatting.

    The result formatting dialog opens, allowing you to choose the color and style for the identify result text.

    Result Formatting
  34. Click the OK to complete the widgets configuration.

Using the Enhanced Search widget

Clicking the Enhanced Search widget in your application displays the widget. Depending on the Initial View choice that was made during configuration the By Attribute or the By Shape view will be visible.

By Attribute

The By Attribute view has a dropdown list of predefined search layers. Selecting a search layer updates the dropdown list of search aliases for that layer (search expressions):

List of searches
Date options

By default all searches create a new result set. But to change the selection dropdown to Add or Remove the search results from the current result set.

add and remove options

By Shape

The By Shape view has a dropdown list of predefined search layers and draw tools for drawing on the map to search for features that intersect the drawn graphics.

Search By Shape

By Spatial

The By Spatial view has buffering options, a dropdown list of predefined search layers and spatial operation buttons.

Spatial Search View

Results

The Results view displays the features returned from the search, and use an alternating color scheme.

List of search results List of search results

URL Search

The URL Search capability can be used by following these guidelines

What's New in version 2.x

This is what's new.