Select to view content in your preferred language

Need help setting up the Enhanced Search Widget

2908
7
Jump to solution
09-05-2012 04:51 PM
GeorgeHaskett
Deactivated User
Hello,

I am a grad student and am new to both the Flex Viewer and xml.  I have managed to get all the other widgets working for me, however I am at a lose with the eSearch widget.  I am using ArcGIS 10.1 and the latest versions of both the eSearch widget and the Flex Viewer.

The search box will appear along with my arguements, however when I click on the search button nothing seems to happen.  My code is pasted below.

Any help would be greatly appreciated.

Thanks,

Haskett

<?xml version="1.0" encoding="utf-8"?>
<!-- See Enhanced Search Widget XML Configuration.pdf for detailed explanation -->
<configuration>
  <layers>
    <layer>
      <definitionexpression></definitionexpression>
      <enableexport>false</enableexport>
      <name>Control Point</name>
      <url>url="http://rd.giscenter.isu.edu/ArcGIS/rest/services/MCPD_beta/MapServer"</url>
      <expressions>
        <expression alias="PLSS PT" textsearchlabel="Search PLSS Point:" isvaluerequired="false">
          <values>
            <value prompt="Example: Yes/No" isvaluerequired="false">PLSSCORNER = '[value]'</value>
          </values>
        </expression>
        <expression alias="Name" textsearchlabel="Search Name:" isvaluerequired="false">
          <values>
            <value prompt="Example: 300420" isvaluerequired="false">POINTNAME = '[value]'</value>
          </values>
        </expression>
        <expression alias="Township" textsearchlabel="Search Township:" isvaluerequired="false">
          <values>
            <value prompt="Example: 6" isvaluerequired="false">TOWNSHIP = '[value]'</value>
          </values>
        </expression>
        <expression alias="Range" textsearchlabel="Search Range:" isvaluerequired="false">
          <values>
            <value prompt="Example: 6" isvaluerequired="false">RANGE = '[value]'</value>
          </values>
        </expression>
      </expressions>
      <graphicalsearchlabel>Use one of the graphical search tools to select Control Points</graphicalsearchlabel>
      <spatialsearchlayer>false</spatialsearchlayer>
      <titlefield>TOWNSHIP</titlefield>
      <fields all="false">
        <field name="PLSSCORNER" alias="PLSS Corner" gridfield="true"></field>
        <field name="POINTNAME" alias="Name" gridfield="true"></field>
        <field name="TOWNSHIP" alias="Township" gridfield="true"></field>
        <field name="RANGE" alias="Range" gridfield="true"></field>
        <field name="OBJECTID" visible="false" />
      </fields>
      <links />
      <zoomscale usegeometry="true" zoompercent="2"></zoomscale>
      <autoopendatagrid>false</autoopendatagrid>
      <queryattachments>false</queryattachments>
      <relates />
      <symbology>
        <simplefillsymbol color="0x0000ff" alpha="0.5">
          <outline color="0x00ffff" alpha="0.8" width="2" />
        </simplefillsymbol>
      </symbology>
    </layer>
  </layers>
  <tables>This section is ONLY for tables (i.e. data that has no geometry)!
  </tables>
  <spatialrelationships>
    <!-- possible spatial relationships esriSpatialRelIntersects | esriSpatialRelContains
   | esriSpatialRelCrosses | esriSpatialRelEnvelopeIntersects | esriSpatialRelIndexIntersects
   | esriSpatialRelOverlaps | esriSpatialRelTouches | esriSpatialRelWithin currently
   unavailable: esriSpatialRelRelation -->
    <spatialrelationship>
      <name>esriSpatialRelContains</name>
      <label>entirely contained in</label>
    </spatialrelationship>
    <spatialrelationship>
      <name>esriSpatialRelIntersects</name>
      <label>interssected by</label>
    </spatialrelationship>
    <spatialrelationship>
      <name>esriSpatialRelEnvelopeIntersects</name>
      <label>intersected by envelop of</label>
    </spatialrelationship>
  </spatialrelationships>
  <bufferunits>
    <bufferunit>
      <name>UNIT_FOOT</name>
      <label>Feet</label>
    </bufferunit>
    <bufferunit>
      <name>UNIT_STATUTE_MILE</name>
      <label>Miles</label>
    </bufferunit>
    <bufferunit>
      <name>UNIT_METER</name>
      <label>Meters</label>
    </bufferunit>
    <bufferunit>
      <name>UNIT_KILOMETER</name>
      <label>Kilometers</label>
    </bufferunit>
  </bufferunits>
  <keepgraphicalsearchenabled>true</keepgraphicalsearchenabled>
  <autozoomtoresults>true</autozoomtoresults>
  <enabledatagridinteractionwithwidget>true</enabledatagridinteractionwithwidget>
  <toleranceforpointgraphicalselection>6</toleranceforpointgraphicalselection>
  <!-- value is in screen pixels -->
  <tolerancebydefault>false</tolerancebydefault>
  <spatialreference>102003</spatialreference>
  <zoomscale>2400</zoomscale>
  <geometryservice>http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer</geometryservice>
  <csvseparator>,</csvseparator>
  <disablebuttons></disablebuttons>
  <!--possible values one or more not all four search types comma separated text,graphic,spatial,grid,datagrid -->
  <defaultselectionoption>textInput</defaultselectionoption>
  <!--possible values only one graphicalInput or textInput or spatialInput -->
  <enabledrawgraphicbutton>true</enabledrawgraphicbutton>
  <enablebuffergraphicbutton>true</enablebuffergraphicbutton>
  <selectedgraphicaltool></selectedgraphicaltool>
  <!-- possible values are extent or polygon or mappoint or polyline or nothing -->
  <multipartgraphicsearch>true</multipartgraphicsearch>
  <floatorfixed>fixed</floatorfixed>
  <!-- possible values are fixed and float -->
  <relatetooltip>Show Relates</relatetooltip>
  <relateicon>widgets/eSearch/assets/images/i_relate.png</relateicon>
  <labels>
    <includetextquery>include text query in selection criteria</includetextquery>
    <includetextquerywarn>Must be the same search layer in both
graphical and text search pages.</includetextquerywarn>
    <buffergrapicprops>Buffer graphic properties</buffergrapicprops>
    <bufferusergraphics>Buffer Graphic</bufferusergraphics>
    <norelatesfound>No related features found for: </norelatesfound>
    <norelatesfoundalerttitle>No Results</norelatesfoundalerttitle>
    <addtolerance>Add search tolerance to point selection</addtolerance>
    <existingdrawgraphicslabel>Use Existing eDraw Widget Graphics</existingdrawgraphicslabel>
    <existingbuffergraphicslabel>Use Existing Point Buffer Widget Graphics</existingbuffergraphicslabel>
    <graphicalsearchlabel>Graphical Search</graphicalsearchlabel>
    <textsearchlabel>Text Search</textsearchlabel>
    <resultslabel>Results</resultslabel>
    <layerlabel>Search Layer:</layerlabel>
    <layerfieldlabel>Search Layer Field:</layerfieldlabel>
    <nolayerlabel>No search layer defined.</nolayerlabel>
    <submitlabel>Search</submitlabel>
    <pointlabel>Select by Point</pointlabel>
    <linelabel>Select by Line</linelabel>
    <rectanglelabel>Select by Rectangle</rectanglelabel>
    <polygonlabel>Select by Polygon</polygonlabel>
    <clearlabel>Clear</clearlabel>
    <loadinglabel>Loading...</loadinglabel>
    <selectionlabel>Features Selected:</selectionlabel>
    <gridresultslabel>Show Results in Grid</gridresultslabel>
    <csvdefaultname>Selected Records</csvdefaultname>
    <relatescsvdefaultname>Related Records</relatescsvdefaultname>
    <exportbtnlabel>Export...</exportbtnlabel>
    <export2csvoptionlabel>Export to CSV...</export2csvoptionlabel>
    <export2txtoptionlabel>Export to Txt...</export2txtoptionlabel>
    <bufferlabel>apply a search distance:</bufferlabel>
    <spatialsearchlabel>Spatial search</spatialsearchlabel>
    <applybufferlabel>Apply buffer</applybufferlabel>
    <searchlayerlabel>Search entities of:</searchlayerlabel>
    <enablemultipartsearch>enable multi-part graphics</enablemultipartsearch>
    <zoomalllabel>Zoom</zoomalllabel>
    <zoomalltip>Zoom to all results</zoomalltip>
    <bufferalpha>Fill opacity</bufferalpha>
    <buffercolor>Fill color</buffercolor>
    <nobuffercolor>No fill color</nobuffercolor>
    <bufferoutlinecolor>Outline color</bufferoutlinecolor>
    <nobufferoutlinecolor>No outline color</nobufferoutlinecolor>
    <bufferoutlinewidth>Outline Width</bufferoutlinewidth>
    <configbuffergra>Configure buffer graphic properties...</configbuffergra>
    <required>*</required>
    <requiredtooltip>This field is required.
Enter a value to enable search button</requiredtooltip>
  </labels>
  <symbols>
    <simplefillsymbol color="0xff0000" alpha="0.5">
      <outline color="0xff0000" alpha="0.8" width="2" />
    </simplefillsymbol>
    <!-- You can have one or the other, either simplemarkersymbol or picturemarkersymbol
   defined for your point results NOT BOTH. picturemarkersymbol will override
   simplemarkersymbol if you do not have it commented out. -->
    <!-- <simplemarkersymbol style="square" size="12" color="0xff0000" alpha="0.5"
   xoffset="0" yoffset="0" angle="0"> <outline style="solid" color="0x000000"
   alpha="1" width="1"/> </simplemarkersymbol> -->
    <picturemarkersymbol url="assets/images/i_search.png" height="30" width="30" xoffset="0" yoffset="0" />
    <simplelinesymbol color="0xff0000" alpha="0.8" width="2" />
  </symbols>
</configuration>
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RhettZufelt
MVP Notable Contributor
as well as no quotes around the url and no url= inside the url tag.

this is working.  Since the PLSS Point search is Yes/No, I made that a userlist.

 <layer>    <definitionexpression></definitionexpression>    <enableexport>true</enableexport>    <name>Control Point</name>    <url>http://rd.giscenter.isu.edu/arcgis/rest/services/MCPD_beta/MapServer/0</url>    <expressions>    <expression alias="PLSS PT" textsearchlabel="Search PLSS Point:" isvaluerequired="false">      <values>       <value prompt="Example: Yes/No" userlist="Yes,No,all" isvaluerequired="false">PLSSCORNER = '[value]'</value>      </values>    </expression>    <expression alias="Name" textsearchlabel="Search Name:" isvaluerequired="false">     <values>          <value prompt="Example: 300420" isvaluerequired="false">POINTNAME = '[value]'</value>     </values>    </expression>    <expression alias="Township" textsearchlabel="Search Township:" isvaluerequired="false">     <values>         <value prompt="Example: 6" isvaluerequired="false">TOWNSHIP = '[value]'</value>     </values>    </expression>    <expression alias="Range" textsearchlabel="Search Range:" isvaluerequired="false">      <values>       <value prompt="Example: 6" isvaluerequired="false">RANGE = '[value]'</value>     </values>    </expression>         </expressions>              <graphicalsearchlabel>Use one of the graphical search tools to select Control Points</graphicalsearchlabel>    <spatialsearchlayer>false</spatialsearchlayer>    <titlefield>TOWNSHIP</titlefield>    <fields all="false">     <field name="TOWNSHIP"/>     <field name="PLSSCORNER" alias="PLSS Corner" gridfield="true"/>     <field name="POINTNAME" alias="Name" gridfield="true"/>     <field name="TOWNSHIP" alias="Township" gridfield="true"/>     <field name="RANGE" alias="Range" gridfield="true"/>     <field name="OBJECTID" visible="false" />    </fields>    <links />    <zoomscale usegeometry="true" zoompercent="2"></zoomscale>    <autoopendatagrid>true</autoopendatagrid>    <queryattachments>false</queryattachments>    <relates />    <symbology>     <simplefillsymbol color="0x0000ff" alpha="0.5">      <outline color="0x00ffff" alpha="0.8" width="2" />     </simplefillsymbol>    </symbology>  </layer>


R_

View solution in original post

0 Kudos
7 Replies
AnthonyGiles
Honored Contributor
George,

You need to set your search up to run against individual layers in your map service so your URL should have a number on the end i.e:

http://rd.giscenter.isu.edu/ArcGIS/rest/services/MCPD_beta/MapServer/0

Regards

Anthony
0 Kudos
RhettZufelt
MVP Notable Contributor
as well as no quotes around the url and no url= inside the url tag.

this is working.  Since the PLSS Point search is Yes/No, I made that a userlist.

 <layer>    <definitionexpression></definitionexpression>    <enableexport>true</enableexport>    <name>Control Point</name>    <url>http://rd.giscenter.isu.edu/arcgis/rest/services/MCPD_beta/MapServer/0</url>    <expressions>    <expression alias="PLSS PT" textsearchlabel="Search PLSS Point:" isvaluerequired="false">      <values>       <value prompt="Example: Yes/No" userlist="Yes,No,all" isvaluerequired="false">PLSSCORNER = '[value]'</value>      </values>    </expression>    <expression alias="Name" textsearchlabel="Search Name:" isvaluerequired="false">     <values>          <value prompt="Example: 300420" isvaluerequired="false">POINTNAME = '[value]'</value>     </values>    </expression>    <expression alias="Township" textsearchlabel="Search Township:" isvaluerequired="false">     <values>         <value prompt="Example: 6" isvaluerequired="false">TOWNSHIP = '[value]'</value>     </values>    </expression>    <expression alias="Range" textsearchlabel="Search Range:" isvaluerequired="false">      <values>       <value prompt="Example: 6" isvaluerequired="false">RANGE = '[value]'</value>     </values>    </expression>         </expressions>              <graphicalsearchlabel>Use one of the graphical search tools to select Control Points</graphicalsearchlabel>    <spatialsearchlayer>false</spatialsearchlayer>    <titlefield>TOWNSHIP</titlefield>    <fields all="false">     <field name="TOWNSHIP"/>     <field name="PLSSCORNER" alias="PLSS Corner" gridfield="true"/>     <field name="POINTNAME" alias="Name" gridfield="true"/>     <field name="TOWNSHIP" alias="Township" gridfield="true"/>     <field name="RANGE" alias="Range" gridfield="true"/>     <field name="OBJECTID" visible="false" />    </fields>    <links />    <zoomscale usegeometry="true" zoompercent="2"></zoomscale>    <autoopendatagrid>true</autoopendatagrid>    <queryattachments>false</queryattachments>    <relates />    <symbology>     <simplefillsymbol color="0x0000ff" alpha="0.5">      <outline color="0x00ffff" alpha="0.8" width="2" />     </simplefillsymbol>    </symbology>  </layer>


R_
0 Kudos
GeorgeHaskett
Deactivated User
Thanks Anthony and R_,

Anthony - I saw thoses earlier and failed to figure that out on my own.

R_ - I think when I originally started the xml I was trying to figure it out in the regular notepad software.  I am now using the XML Notepad software which is making it a bit easier to ready and understand.

Thanks again to both of you.

Haskett
0 Kudos
RhettZufelt
MVP Notable Contributor
Glad you got it working.

Since you have your own server, you may want to create a geometry service and replace this with yours:

<geometryservice>http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer</geometryservice>


Not sure how large your searched data is, but I find some improvment using my own geometry server rather than hitting ESRI's (sometimes I guess, depends on the status of "our" network).

Of course, not sure if it matters if you don't do spatial searches.

R_

How's Poky treating you?
0 Kudos
GeorgeHaskett
Deactivated User
Rhett,

Just going through old posts and noticed your comment on 'Poky', are you from here?  Not too many people use that term unless they were once locals.

I'm originally from here, however I moved away years ago and managed to finally come back for my masters at ISU.  A lot has changed over the years I was gone.

Anyways, so you were implying that if I created my own geometry service then things should move quicker?
Is this easy enough to do and well documented?

I'd imagine that working off of our server would be quicker than ESRI's.

Haskett
0 Kudos
AnthonyGiles
Honored Contributor
George,

If your are using server 10.1 the geometry service is already created under the utilities folder, see:

http://resources.arcgis.com/en/help/main/10.1/index.html#//0154000004n5000000

If you are using an earlier version of server you have to create it yourself, which is simple, see:

http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/index.html#//009300000027...

Regards

Anthony
0 Kudos
RhettZufelt
MVP Notable Contributor
George,

Grew up in Island Park and Challis.  Lots of buddies still in the Pokasmello/Idiot Flats area.  I see you are mapping their "hunting" areas 😮

Still have a buddy there in Poky that fishes Tuna with me each year.  About the longest boat haul to the coast I'm aware of (at least, for a "regular").....

R_
0 Kudos