Enhanced Search Widget Version 2.23.1 - 11/22/22

533869
2821
07-14-2014 03:57 PM
Labels (1)

Enhanced Search Widget Version 2.23.1 - 11/22/22

Live Preview Site

Web AppBuilder for ArcGIS | Help - Enhanced Search widget

 

List of the latest enhancements and changes:

  1. Fixed issue with Spatial Relationship settings

Older enhancements or changes

Check the "Older enhancements or changes.txt" in the download for a complete list.

 

Older Versions

Last 2.21 version

Last 2.17 version

Last 2.13 version

Last 2.12 version

Last 2.11 version

Last 2.9 version

Last 2.7 version

Last 2.6 version

Last 2.5 version

Labels (1)
Attachments
Comments

Thanks!

Hi Robert,

I'm having trouble with your e-search widget. I have several features that I have set up queries. They are all designed so that results are added as a layer, and it should open the attribute table. Some of the queries won't show up in either. You can see in my page below. Two examples are Property Values (tract) which works as it should, while the Habitat Priority does not.

https://newcoastalatlas.tamug.edu/javamap/index.html

I'm not sure why this is occurring.

Thanks Will

Update: it looks like the console error I'm getting "results.features.geometry is null"

Robert,

Is there a way to have this search multiple layers at the same time?  We currently have a search utility in FLEX that allows us to search multiple layers (from different URL's) at the same time and produce a report.

William,

   There is a bug when enteracting with the attribute table right now that I will be fixing in the next release. In the mean time the work around for the error you are reporting is to turn AutoZoom off in the widgets configuration.

Daniel,

   No as the eSearch and uses the Query task which is only for one service endpoint you can not search more than one simultaneously. I am interested how your utility got around this.

Thanks for the response. I tried turning off the AutoZoom feature. It still is having the same issues.

William,

   When I go to your site and check the json file for the eSearch it still has "autozoomtoresults": true.

https://newcoastalatlas.tamug.edu/javamap/configs/eSearch/config_Query.json

Oops sorry I had not uploaded it to the server I was using the app builder. Its now updated through that link.

William,

So your issue with the habitat layer is that you have the shape field hidden in the map service and thus this make queries against the map service layer that are requesting geometry absolutely useless.

Layer: Habitat Priority (ID: 5)

You need to go into the map service in ArcMap and unhide (show) the shape field and then republish the map service.

Yup, that fixed it. Thank you for taking you time to help me this morning! Its greatly appreciated.

Hi Robert,

Will the Enhanced Search Tool ever have the ability to export search results as a shapefile?

Thanks,
Rich

Anonymous User

Rich HammondRobert Scheitlin

Rich, excellent idea. Although I had a thought: part of the wisdom of Robert leveraging ESRI's built-in Attribute Table widget is that as ESRI increases the Attribute Table's functionality, eSearch gains it as well. So, I think this would be a good thing for ESRI to add to the Attribute Table. (currently, it exports CSV but not shapefile...yet)   Plus, any other widgets could then also hook in to the Attrib table.

For example, I hope that when I get my Select / Query widget done, hooking in to the Attrib table, that would be good as well if it could export to .shp.   I also say this as Robert has been so industrious in creating widgets, and perhaps offloading this to ESRI would allow for more specialized dev time on eSearch on other feature requests, whereas Export to .SHP would be useful to all, if it were in the Attrib Table. Of course he adds it before ESRI does for Attrib table that would also be nice. Either way. Just my thoughts.

Anyone from ESRI think you'll add this to the Attrib Table sometime in the future?

Robert,

When the search returns an operational layer is there a way to remove the service name before the "Search Results:" in the Legend?

"ESearchLegend.JPG

Chad,

   This is something I will be fixing in the next release (thanks to your info you provided).

Congratulations Robert!!!

Jack recognized your contribution to ESRI's Online Community by awarding you the GeoNet Launch Champions Award at the Closing Ceremony today at the 2015 ESRI User Conference.

Robert.JPG

All the Directors were on stage along with Jack.

Your invaluable work with the Custom Widgets for the Web AppBuilder along with the Customization Resource List maintained by Rebecca Strauch were mentioned by Derek Law at the Web AppBuilder Technical Sessions.

On behalf on the Web AppBuilder Community, I would like to say a million thanks to you and Rebecca.

What you do is a work of passion.

you first said "after you have done that then go configure the app in app builder" but i have already configured the app, then you said change the name of a eSrach layer, sybmology any of the options, does it have to be an actual layer or a made up one? So after i replace the eSearch file in stemapp i change change a layer name in the eSarch/config_EnhancedSearch.json file i save it, do i go back and undo the change and re-save.

please forgive my ignorance.

What i did was replace the eSearch folder in the stemap folder then the appbuilder and opened the  eSarch/config_EnhancedSearch.json changed a layers URL from FeatureSever/2 to Feature Server/3 and saved. I exited out of appbuilder and change FeatureServer/3 back to FeatureServer/2 and saved, then re-opend appbuilder. is this acquit enough?

2CDSD 2C,

you first said "after you have done that then go configure the app in app builder" but i have already configured the app

What I mean is that you open the app in Web AppBuilder so that you can use the eSearch configuration UI.

then you said change the name of a eSrach layer, sybmology any of the options, does it have to be an actual layer or a made up one?

Honestly is does not matter what you change as long as you make SOME change, using the eSearch Widget configuration UI.

So after i replace the eSearch file in stemapp i change change a layer name in the eSearch/config_EnhancedSearch.json file i save it, do i go back and undo the change and re-save.

If you are opening the json file in a text editor then this is not fulfilling the purpose of making the change. The whole point in making a change is so that the eSearch Settings UI will write any new settings properties to the json when you click the save button.

Robert Scheitlin, GISP

Hello Robert,

Could you please point me to the right resource to help me implement the eSearch widget within Portal for ArcGIS 10.3.1 WAB. I am not a developer and have gone through this forum to find a step by step illustration, to no avail.

I look forward to your response.

Lara

Lara,

   Custom widget can not be used in ArcGIS Portal. See this esri blog on this subject.

Clarifying 3 questions about Web AppBuilder for ArcGIS | ArcGIS Blog

Understood! Thank you.

Hi Robert.

When we do aliasing for the attribute fields then we can see the alias in the results window but not in the attribute table which popups , Can you please suggest how to aliasing in the attribute table also. because this is very important when we export the data.

Thanks and Regards,

Ravi

Ravi,

   You need to alias your fields before you publish your data to a map service. I provide a way to assign aliases for fields in my widget, but other widgets like the attribute table widget will look for the field alias to come from ArcGIS Server based on the alias give to the field in ArcMap before publishing the map service.

Hi Robert. I have just implemented this in my WAB. I am trying to use the same service for multiple variations of the search. More specifically, my service is for my entire area, but I would like to have individual searches per sub area (a field in my service). Instead of having to create multiple services per sub area, I am using the Definition Expression to add the expression for each sub area. When setting each of them up, the dropdown list when using Unique values in the Update Expression Value windows shows the correct values for that sub area, however, when actually running the tool in my map, all the Unique value dropdown lists for all the sub areas only show the list for my first sub area.

Am I doing something wrong here? Thanks. Julian.

Julian,

   Can you share your json configuration?

in the esearch widget.js i put:

currentLayer._titleForLegend = this.resultLayers[layerIndex].name;

and that took the service name out of the legend after the search is complete.

Here is my config with some screenshots.

###############################################

{

  "layers": [

    {

      "name": "In Progress (Amahlati)",

      "url": "http://localhost/arcgis/rest/services/Amathole/ApplicationStatusSearch/MapServer/0",

      "definitionexpression": "LM = 'Amahlathi'",

      "spatialsearchlayer": false,

      "zoomScale": 10000,

      "shareResult": false,

      "addToAttrib": false,

      "expressions": {

        "expression": [

          {

            "alias": "Application ID",

            "textsearchlabel": "Search by Application ID",

            "values": {

              "value": [

                {

                  "fieldObj": {

                    "name": "AppID",

                    "label": "Application ID",

                    "shortType": "string",

                    "type": "esriFieldTypeString"

                  },

                  "valueObj": {

                    "value": "allu"

                  },

                  "prompt": "Application ID",

                  "textsearchhint": "150725_...",

                  "sqltext": "AppID = '[value]'",

                  "operation": "stringOperatorIs",

                  "uniquevalsfromfield": "AppID"

                }

              ]

            }

          }

        ]

      },

      "titlefield": null,

      "fields": {

        "all": false,

        "field": [

          {

            "name": "SGCODE",

            "alias": "SG Code"

          },

          {

            "name": "AppID",

            "alias": "Application ID"

          },

          {

            "name": "ApplicationType",

            "alias": "Application Type"

          },

          {

            "name": "ApplicationStatus",

            "alias": "Application Status"

          },

          {

            "name": "ApplicationDate",

            "alias": "Date",

            "isdate": true

          },

          {

            "name": "MAPLABEL",

            "alias": "Erf No."

          },

          {

            "name": "PORTIONNO",

            "alias": "Portion"

          },

          {

            "name": "SGNUMBER",

            "alias": "SG No."

          },

          {

            "name": "FARMTOWNNA",

            "alias": "Area Name"

          },

          {

            "name": "GISAREA",

            "alias": "Area (m²)",

            "isnumber": true

          },

          {

            "name": "LM",

            "alias": "LM Name"

          },

          {

            "name": "LM_ZONE",

            "alias": "LM_ZONE"

          }

        ]

      },

      "links": {

        "link": []

      },

      "showattachments": false,

      "layersymbolfrom": "config"

    },

    {

      "name": "In Progress (Nkonkobe)",

      "url": "http://localhost/arcgis/rest/services/Amathole/ApplicationStatusSearch/MapServer/0",

      "definitionexpression": "LM = 'Nkonkobe'",

      "spatialsearchlayer": false,

      "zoomScale": 10000,

      "shareResult": false,

      "addToAttrib": false,

      "expressions": {

        "expression": [

          {

            "alias": "Application ID",

            "textsearchlabel": "Search by Application ID",

            "values": {

              "value": [

                {

                  "fieldObj": {

                    "name": "AppID",

                    "label": "Application ID",

                    "shortType": "string",

                    "type": "esriFieldTypeString"

                  },

                  "valueObj": {

                    "value": "allu"

                  },

                  "prompt": "Application ID",

                  "textsearchhint": "150725_...",

                  "sqltext": "AppID = '[value]'",

                  "operation": "stringOperatorIs",

                  "uniquevalsfromfield": "AppID"

                }

              ]

            }

          },

          {

            "alias": "Erf No.",

            "textsearchlabel": "Search by Erf No.",

            "values": {

              "value": [

                {

                  "fieldObj": {

                    "name": "MAPLABEL",

                    "label": "Erf No.",

                    "shortType": "string",

                    "type": "esriFieldTypeString"

                  },

                  "valueObj": {

                    "value": ""

                  },

                  "prompt": "Erf No.",

                  "textsearchhint": "1024",

                  "sqltext": "Upper(MAPLABEL) = Upper('[value]')",

                  "operation": "stringOperatorIs"

                },

                {

                  "fieldObj": {

                    "name": "FARMTOWNNA",

                    "label": "Area Name",

                    "shortType": "string",

                    "type": "esriFieldTypeString"

                  },

                  "valueObj": {

                    "value": "allu"

                  },

                  "prompt": "Area Name",

                  "textsearchhint": "FORT BEAUFORT",

                  "sqltext": "FARMTOWNNA = '[value]'",

                  "operation": "stringOperatorIs",

                  "uniquevalsfromfield": "FARMTOWNNA",

                  "operator": "AND"

                }

              ]

            }

          }

        ]

      },

      "titlefield": null,

      "fields": {

        "all": false,

        "field": [

          {

            "name": "SGCODE",

            "alias": "SG Code"

          },

          {

            "name": "AppID",

            "alias": "Application ID"

          },

          {

            "name": "ApplicationType",

            "alias": "Application Type"

          },

          {

            "name": "ApplicationStatus",

            "alias": "Application Status"

          },

          {

            "name": "ApplicationDate",

            "alias": "Date",

            "isdate": true

          },

          {

            "name": "MAPLABEL",

            "alias": "Erf No."

          },

          {

            "name": "PORTIONNO",

            "alias": "Portion"

          },

          {

            "name": "SGNUMBER",

            "alias": "SG No."

          },

          {

            "name": "FARMTOWNNA",

            "alias": "Area Name"

          },

          {

            "name": "GISAREA",

            "alias": "Area (m²)",

            "isnumber": true

          },

          {

            "name": "LM",

            "alias": "LM Name"

          },

          {

            "name": "LM_LANDUSE",

            "alias": "Landuse"

          },

          {

            "name": "LM_ZONE",

            "alias": "LM_ZONE"

          }

        ]

      },

      "links": {

        "link": []

      },

      "showattachments": false,

      "layersymbolfrom": "config"

    },

    {

      "name": "In Progress (All)",

      "url": "http://localhost/arcgis/rest/services/Amathole/ApplicationStatusSearch/MapServer/0",

      "definitionexpression": "",

      "spatialsearchlayer": false,

      "zoomScale": 10000,

      "shareResult": false,

      "addToAttrib": false,

      "expressions": {

        "expression": [

          {

            "alias": "Application ID",

            "textsearchlabel": "Search by Application ID",

            "values": {

              "value": [

                {

                  "fieldObj": {

                    "name": "AppID",

                    "label": "Application ID",

                    "shortType": "string",

                    "type": "esriFieldTypeString"

                  },

                  "valueObj": {

                    "value": "allu"

                  },

                  "prompt": "Application ID",

                  "textsearchhint": "150725_...",

                  "sqltext": "AppID = '[value]'",

                  "operation": "stringOperatorIs",

                  "uniquevalsfromfield": "AppID"

                }

              ]

            }

          }

        ]

      },

      "titlefield": null,

      "fields": {

        "all": false,

        "field": [

          {

            "name": "SGCODE",

            "alias": "SG Code"

          },

          {

            "name": "AppID",

            "alias": "Application ID"

          },

          {

            "name": "ApplicationType",

            "alias": "Application Type"

          },

          {

            "name": "ApplicationStatus",

            "alias": "Application Status"

          },

          {

            "name": "MAPLABEL",

            "alias": "Erf No."

          },

          {

            "name": "PORTIONNO",

            "alias": "Portion"

          },

          {

            "name": "SGNUMBER",

            "alias": "SG No."

          },

          {

            "name": "FARMTOWNNA",

            "alias": "Area Name"

          },

          {

            "name": "GISAREA",

            "alias": "Area (m²)",

            "isnumber": true

          },

          {

            "name": "LM",

            "alias": "LM Name"

          },

          {

            "name": "LM_ZONE",

            "alias": "LM_ZONE"

          }

        ]

      },

      "links": {

        "link": []

      },

      "showattachments": false,

      "layersymbolfrom": "config"

    }

  ],

  "initialView": "text",

  "multipartgraphicsearchchecked": false,

  "addpointtolerancechecked": false,

  "limitsearch2mapextentchecked": false,

  "keepgraphicalsearchenabled": true,

  "autozoomtoresults": true,

  "mouseovergraphics": false,

  "toleranceforpointgraphicalselection": 6,

  "bufferDefaults": {

    "bufferUnits": {

      "bufferUnit": [

        {

          "name": "UNIT_FOOT",

          "label": "Feet"

        },

        {

          "name": "UNIT_STATUTE_MILE",

          "label": "Miles"

        },

        {

          "name": "UNIT_METER",

          "label": "Meter"

        }

      ]

    },

    "bufferDefaultValue": 5,

    "bufferWKID": 102003,

    "simplefillsymbol": {

      "color": [

        1,

        185,

        253,

        128

      ],

      "outline": {

        "color": [

          1,

          185,

          253,

          204

        ],

        "width": 1,

        "type": "esriSLS",

        "style": "esriSLSSolid"

      },

      "type": "esriSFS",

      "style": "esriSFSSolid"

    }

  },

  "spatialrelationships": {

    "spatialrelationship": [

      {

        "name": "esriSpatialRelContains",

        "label": "entirely contained in"

      },

      {

        "name": "esriSpatialRelIntersects",

        "label": "intersected by"

      },

      {

        "name": "esriSpatialRelEnvelopeIntersects",

        "label": "intersected by envelope of"

      }

    ]

  },

  "graphicalsearchoptions": {

    "enablepointselect": true,

    "enablelineselect": true

  },

  "symbols": {

    "simplemarkersymbol": null,

    "picturemarkersymbol": {

      "url": "/widgets/eSearch/images/i_search.png",

      "height": "20",

      "width": "20",

      "type": "esriPMS",

      "angle": "0"

    },

    "simplelinesymbol": {

      "type": "esriSLS",

      "style": "esriSLSSolid",

      "color": [

        255,

        0,

        0,

        204

      ],

      "width": 2

    },

    "simplefillsymbol": {

      "color": [

        255,

        0,

        0,

        128

      ],

      "outline": {

        "color": [

          255,

          0,

          0,

          204

        ],

        "width": 2,

        "type": "esriSLS",

        "style": "esriSLSSolid"

      },

      "type": "esriSFS",

      "style": "esriSFSSolid"

    }

  }

}

###############################################

2015-07-31_102556.png

2015-07-31_102624.png

2015-07-31_102643.png

Julian,

   Try manually editing your json and making this change for each of your layers.

You currently have:

                 "valueObj": {

                    "value": "allu"

                  },

Change to:

                 "valueObj": {

                    "value": ""

                  },

Robert,

i have been doing other things for awhile now but i am back to working with your wonderful widget.

i just noticed something.

i have a query that is set to the 'unique' option.

i love this, but i am wondering if there is parameter somewhere that limits the number of values that will be displayed in the drop-down list, as i am not seeing all the values i expect.

in this case i may revert to 'starts with' option and let the users type in the first part, as it might not really be very workable to have all the values displayed.

Glenn,

   There should be no reason that the drop down does not display all your unique values for that field. How many unique values are you talking about?

Hi Robert, unfortunately this did not work. I am still getting the complete list for my first definition query. I even added a new entry to this area and it is now available in all the other area options.

there are 4,000.

i didn't realize how many there were.

even if it worked it would not be a good option.

i'm going to use the 'starts with' option instead.

Hello everyone,

in particular thanks to Robert for his excellent work. One question: I need to see the values of domain esearch 1.1.9.

It's possible?

There is a configuration parameter?

My configuration

ArcGIS Server 10.3.1

ArcGIS Portal 10.3.1

WAB 1.1

Service published file geodatabase

Thank you

Massimo,

   There is no configuration for this that needs to be set. When you choose a field that has a Domain the widget will automatically use the Domain values.

Julian,

   I am looking into this.

Robert, the fields of featurelayers are connected to a domain.

In the script Widtget.js I verified that the variable typeID is always null

var typeID = currentLayer.typeIdField? featureAttributes [currentLayer.typeIdField]: null;

and therefore

var = codedValue this._getCodedValue (currentLayer, att, value, typeID);

is null.

What is currentlayer.typeIdFied?

Thank you very much for quick response

Massimo,

   The typeId is only used when you are using a feature with subtypes

Julian,

   I found the issue to be some code optimization/caching that I was doing to prevent the retrieval of the unique values when I already got them one time. But I was only using the layer URL and the Field name as the unique identifier. I now will have to use the URL + field name + def query. I will fix this in the next release.

Thanks Robert, if you didn't know it already, you are awesome .

Hello Robert,

excuse me, but the problem persists.

I checked in

_getCodedValue: function (layer, fieldName, fieldValue, typeID) {

into code fragment

if (codedValueDomain) {

             if (codedValueDomain.type === 'codedValue') {

             for (var cv = 0; cv <codedValueDomain.codedValues.length; cv ++) {

                 var = codedValue codedValueDomain.codedValues [cv];

               if (fieldValue === codedValue.code) {

                 result = codedValue;

                 break;

               }

             }

           }

         }

if I change the line if (fieldValue === codedValue.code) {

with

  if (fieldValue == codedValue.code) {

I see correctly codedvaluedomain.

It's correct?

Thanks as always

Massimo,

   No one has reported an issue with coded values. Can you put this line of code in before the if and let me know what the difference if between the fieldValue and the codedValue.code?

The difference between == and === if that  === checks for equal value and equal type and == only checks for equal value.

console.info("Field Value: " + fieldValue, "Coded Value Code: " + codedValue.code);

Robert,

this is a part of the console.log

Widget.js: 1652 Field Value: 1 Coded Value Code: 1

Widget.js: 1652 Field Value: 1 Coded Value Code: 0

Widget.js: 1652 Field Value: 1 Coded Value Code: 1

Widget.js: 1652 Field Value: 3 Coded Value Code: 0

Widget.js: 1652 Field Value: 3 Coded Value Code: 1

Widget.js: 1652 Field Value: 3 Coded Value Code: 2

Widget.js: 1652 Field Value: 3 Coded Value Code: 3

...

This is the code snippet

if (codedValueDomain) {

             if (codedValueDomain.type === 'codedValue') {

             for (var cv = 0; cv <codedValueDomain.codedValues.length; cv ++) {

                 var = codedValue codedValueDomain.codedValues [cv];

                 console.info ("Field Value:" + fieldValue, "Coded Value Code:" + codedValue.code);

                 if (fieldValue == codedValue.code) {

                 result = codedValue;

                 break;

               }

             }

           }

         }

Massimo,

   Thanks for the info. One more question, so I can decide where to go with this. What Is your field type for that field? It sounds like a string being compared to a number issue.

Robert,

the type is long integer for all fields that have a domain. The code value of domain is numeric, the description is a string.

Massimo,

   OK, I found the true issue. When getting the fields value I was converting/casting it to a string. So the proper fix in my book would be to change this line var codedValue = this._getCodedValue(currentLayer, att, value, typeID); to var codedValue = this._getCodedValue(currentLayer, att, fieldValue, typeID); and not change the ===. Thanks for reporting this.

Robert,

thanks a lot. I'm glad to be working to improve your product.

Robert,

Whats the best way to upgrade the ESearch widget while maintaining the customized queries & field selection configurations? Can I get away with installing your new ESearch widget files & then just copy over the previous version's ..//server/apps/AppID#/config_(esearch).json file? Or do i have to reconfigure all of my existing Queries & Field selections again through the builder interface? What's your best practice?

I have tried copying the App#/configs/ESearch/config_Enhanced Search.json file over and it appears to work correctly but i wanted to make sure that what im seeing is actually in sync & all is well in ESearch-land..

Thanks for all you do,

Gerald

Hi Gerald,

I followed these steps while upgrading Robert's eSearch Widget from version 1.1.9 to 1.1.10

1. Replace the eSearch folder in client\stemapp\widgets with version 1.1.10 of the eSearch folder.

2. Launch the Web AppBuilder.

3. Duplicate the existing app into a new App.

4. Edit the new App.

All my configurations were preserved. I got to access the new functions of the eSearch widget in version 1.1.10

Thanks,

Tapas

Gerald,

   What you are doing is fine. Just add one step. Once you copy the json over open the app in WAB and go to the eSearch widget and click the edit button to open the configuration dialog and adjust one setting (it does not matter what i.e. some checkbox on the main page, check it then put it right back) so that you get WAB to enable the save button. This will add any changes I have made to the json file internally.

Beautiful ! Works like a charm.

Thanks again, Robert.

Gerald

isn't also possible to replace the esearch contents in the C:\inetpub\wwwroot\WAB\server\apps\11\widgets folder?

or is it better to duplicate the site after repalcing the esearch folder in the C:\inetpub\wwwroot\WAB\client\stemapp\widgets\ folder??

Version history
Last update:
‎11-22-2022 07:31 AM
Updated by: