Search Widget

2614
17
Jump to solution
03-27-2012 02:20 PM
by Anonymous User
Not applicable
After a day of fooling with this Flexviewer, I've finally got it where I can push maps  to the public.  I'd like to push our address data out and make it searchable for other local entities.  I'm having trouble setting up the search widget to make this happen.  I add a new search, save it, open the viewer and I can only search by selection, and I'm wanting to search by attribute via text string.  Any ideas?
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Jamie,   Yes by default the search widget is not designed for multi field searches.

View solution in original post

0 Kudos
17 Replies
by Anonymous User
Not applicable
I've read the forums here and keep seeing the modified search widget pop up.  Don't want you to think I haven't at least tried to research it.  I only ask that particular question because I don't know programming or xml or anything else really.  It would be awesome to see a UI tool that would build this sort of thing.  That being said, I can tackle it and push through and eventually get it.  I just don't want to burn up a few days on it if it's not going to be something pretty close to what I'm looking for. 

Again, I'm looking for a widget/toolbox/whatever that will allow me to use text to search an address layer I have within flex viewer.  For example, if my address  is 123 Idiot Drive, I want to be able to type in 123 idiot and get a list of addresses that match that.

Thanks,

Jamie
0 Kudos
AnthonyGiles
Frequent Contributor
Jamie,

The esearch widget created by Robert will allow you to do what you want without having to do any coding apart from amending the config file that comes with the widget.

There is a set of tags called <defaultselectionoption> that allows you set the initial input type for the search to either graphical, textual or spatial, so if you want the user to type his search into a text box set the value of this tag as follows:

<defaultselectionoption>textInput</defaultselectionoption>

To search for any match in a string set the expression of the search to be something like:

FieldName like '%' + '[value]' + '%'

the % symbol will then act as a wildcard in your search.

This would satisfy your question but ideally if you are wanting to search for an address you would want to use a geocode service that you can create yourself if you have access to your own ArcGIS Server or utilise one that is provided on line. Have a look at the Locate tool in the flex viewer.

Hope this helps

Anthony
0 Kudos
by Anonymous User
Not applicable
Anthony,

Buddy!  Thanks for your reply.   I appreciate it.   I think I've got what you're saying.   Going to try to tackle it now.   I have yet to see it explained like this, so that's good.   I think some people take for granted just how little some of us know about Flex.   Thanks again for your reply. 

Jamie
0 Kudos
by Anonymous User
Not applicable
Here's something I don't understand.

When you open the builder, There's clearly a Search Widget that as far as I'm concerned, it at least looks like it will do what I need it to do straight out of the box.  See the below image.   If I point to my Address service, create a Search within that widget...why doesn't that work?   Why is it neccessary to add all this other stuff?   I'm regretting this move to Flex already despite how awesome it looks.  I already miss being able to take a MXD, push it to the server and publish a map to the public. 

Sorry for whining.  It's my own fault, I just don't know Flex.
[ATTACH=CONFIG]13085[/ATTACH]
0 Kudos
by Anonymous User
Not applicable
Anyone else care to chime in on my last post?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jamie,

   The OOTB Search widget is looking for a mapservice url to a particular layer in a map service and not a Address or geocoder service (this might just been a terminology issue here). Once you enter a url like this "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_LandRecords_Louisville/M..." are you hitting load so that you can define which fields you will search on?

Have you seen the Application Builder documentation?

http://help.arcgis.com/en/webapps/flexviewer/help/index.html#/Getting_started_with_the_application_b...
0 Kudos
by Anonymous User
Not applicable
rscheitlin


Jamie,

The OOTB Search widget is looking for a mapservice url to a particular layer in a map service and not a Address or geocoder service (this might just been a terminology issue here). Once you enter a url like this "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_LandRecords_Louisville/M..." are you hitting load so that you can define which fields you will search on?

Have you seen the Application Builder documentation?

http://help.arcgis.com/en/webapps/flexviewer/help/index.html#/Getting_started_with_the_application_b...


Robert,

Yes, when I load my own URL which would be http://<mysersver>/arcgis/rest/services/rapc/Addresses/Mapserver/0.   I hit load, I pick and choose what to base the search off of and save it.   After saving the map, I can go see the changes on the live map and see that I've added a Search widget but the widget only has the Search by selecting features.   I have no tab to search with text, or by attribute.  I've seen the documentation, maybe I've missed something though.  I'll look over it again.

Thanks,

Jamie
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jamie,

   Did you put anything in the expression textbox when you added your search and if so what? Did you include fields?
0 Kudos
by Anonymous User
Not applicable
Well, judging how you asked that question, I'm guessing something has to be there.  But for the life of me, I couldn't find anything on "Expression" so it's been blank.

Jamie
0 Kudos