esearch widget, returning zero results for fields with domains (title edit: domain wasn't issue -rs))

4596
7
Jump to solution
02-05-2015 03:05 PM
RebeccaStrauch__GISP
MVP Emeritus

Robert Scheitlin, GISP‌  (or anyone) - I have the latest version of  Enhanced Search Widget Version 1.1.0.3 installed, and have been reading thru the thread and thru the help Web AppBuilder for ArcGIS | Help - Enhanced Search widget   in the help, you mention mention

If your field choice is a field that uses a domain then the domain values will automatically be displayed in a dropdown list during configuration and in the widget UI when the widget is used. The same is true for the Unique option, the widget will query the map service for unique values to populate the dropdown with in the widget.

My drop down is working as I would like, with the Text value vs the code, however, my results continue to come up as 0 results.  Currently the spatial (i.e. first tab) is also coming up with 0, and I thought that part was working for me yesterday.  This is my serach

This is from a secure service (using the latest 1.3  LocalLayer widget).  So, there are many elements involved.  Do you have any additional guidance on the use of field with domains in the Sql Statement?

With so many updates the past few days, I may just need to step back and start clean, step by step.  Never hurts to do that anyway to understand the process.

Any suggestions on what I should check before going that route?

0 Kudos
1 Solution

Accepted Solutions
RebeccaStrauch__GISP
MVP Emeritus

This is a summary and follow-up so I can mark this question as answered.

The three steps Robert suggested helped me determine that my esearch setup was incorrect (Thanks Robert Scheitlin, GISP for a very nice workflow for troubleshooting). 

My problem turned out to be that I had both a "Definition Expression" entered on the top level of editing a custom search, which is what added the highlighted portion below,

,

AND another expression set in a "Search Expression()".  I had both since the "hint" for Definition Expression made me think I needed something there.  Once I removed my entry in the the "Definition Expression", it seems to work better.

In other words, the fact that I have a domain attached to the field had no impact on my issue.

View solution in original post

0 Kudos
7 Replies
RobertScheitlin__GISP
MVP Emeritus

Rebecca,

   If you use the SQL where clause of Upper(Species) = Upper('Brown Bear') (or what ever the actual value of Brown Bear in the coded domain is) in your rest service end point. Do you get results? There should be nothing that you have to do manually to configure a field that uses a domain all this is done for you behind the scenes.

RebeccaStrauch__GISP
MVP Emeritus

Testing on my dev setup, initial tests with a query get also gets me Zero results.  Not sure if that is exactly the same as you mentioned for me to try, but if so, then I'll dig more into my services until I get this to work.  This should have given me some results...

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rebecca,

  This is exactly the test you need to do. So the question is how familiar are you with the data? If the Species field is a coded domain then what is the actual value that is stored in the database when you choose the coded label of 'Brown Bear'? you can substitute the where clause with 1=1 and for out field just put SPecies and make sure to choose return geometry to false. This will give you actual values in the DB for the species field.

RebeccaStrauch__GISP
MVP Emeritus

Very familiar with the data.

Results from "1=1" REST query returns results, as expected.

Results from "Upper(Species) = Upper('B')" query returns results, as expected

The domain for the field looks like this:

The widget, with the configuration as shown in the question does show the "Description" in the GUI, which is the desired user interface.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rebecca,

   OK if you open you developer tools right after you submit your search the console should show the exact SQL where clause that was submitted to the server (i.e. "Upper(Code) = Upper('1TH')").

RebeccaStrauch__GISP
MVP Emeritus

My setup in equery is:

(Species like 'Brown Bear') AND (Upper(Species) = Upper('B'))

and the REST query is:

Upper(Species) = Upper('B')

So I obviously have something configured wrong in the widget, since i'm assuming it will not be an "AND".  I'm wondering if it's holding on to my initial attempts to get it right.  Maybe it wrote my query string, and when I changed it, the file did not update?  That's fixable for me, I think, if I find the file to modify.  If so, maybe a fluke?

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

This is a summary and follow-up so I can mark this question as answered.

The three steps Robert suggested helped me determine that my esearch setup was incorrect (Thanks Robert Scheitlin, GISP for a very nice workflow for troubleshooting). 

My problem turned out to be that I had both a "Definition Expression" entered on the top level of editing a custom search, which is what added the highlighted portion below,

,

AND another expression set in a "Search Expression()".  I had both since the "hint" for Definition Expression made me think I needed something there.  Once I removed my entry in the the "Definition Expression", it seems to work better.

In other words, the fact that I have a domain attached to the field had no impact on my issue.

0 Kudos