Select to view content in your preferred language

Search Widget

3034
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
17 Replies
RobertScheitlin__GISP
MVP Emeritus
Jamie,

     The Flex Team has had some feedback on this and this being the first couple of releases of the Application Builder, it will get better as more people provide feed back.  Right now you would have to go to the actual search widget and look at the help for that particular widget and you will find the expression has this comment:
Predefined query for the widget used in the attribute (text) search. For example, PARCELID = '[value]' .
So you need to know a little SQL to know what to put in there. If you need specific help just let me know what field in your data you want to search for a value in and if you will want the user to know the exact value to be type or if you want them to just enter "Jones St." and it will find 123 Jones St.
0 Kudos
by Anonymous User
Not applicable
Robert,

Let me start by saying thanks for your help. I see you all over these forums.  You're like a wizard of flexviewer.

So, in a perfect world, I would like people to search by a specific address.  As in, the municipal attribute and the address attribute.  I know that seems redundant but we have some really old data mixed in with our current data that may or may not have the full address in the "address" attribute.  However, they will have "municipal" if the address isn't there.  There are so many addresses and we only have myself and one other in our department.

Hopefully I explained that well enough.
0 Kudos
by Anonymous User
Not applicable
So the two fields are "address" and "municiple".
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jamie,

   OK the Expression for these fields would look like this then:


  1. Upper(municiple) Like Upper('%[value]%')

  2. Upper(address) Like Upper('%[value]%')

You use the Upper() command to remove the possibility of upper vs lower case causing an issue.
Next you use Like and the % wild card to find values that are like what the user will type.
So single quotes mean you are searching for text and '%[value]%' means that if they type jones than it will find anything with jones as part of it like 123 jones st.
0 Kudos
by Anonymous User
Not applicable
Ok, I'm getting some function now.   Do you put the string in exactly as you typed it, with the numbering?   I've tried with and without the numbers, with and without spaces and so on but have yet to get both of them to work.   I can only get one or the other.  

For instacne,

If I type:                                                  Upper(municiple) Like Upper('%[value]%')


I get the Search by Attribute tab and I'm able to search the Municiple field. 


And the same for the other, if I type:          Upper(address) Like Upper('%[value]%')

I can search the Address field.   But no matter how I type both, I keep getting a 400 error.  Do the numbers stay or go?

Thanks Robert.

Jamie
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jamie,   Yes by default the search widget is not designed for multi field searches.
0 Kudos
by Anonymous User
Not applicable
Gotcha.   And I'm assuming that's the reason, with many others, that you made the Enhanced Search Widget?   After going through this and watching the SearchWidget.xml change, I think I understand it way more than before. 

Thanks again Robert.  I appreciate you taking time out to walk me through it.

Jamie
0 Kudos
by Anonymous User
Not applicable
So, after feeling my way around for a bit...I don't think the Search function is capable of doing exactly what I need it to do without getting outside of what I know and don't know.

I went with Anthony's suggestion and created a geocode service for "Locate".  For some reason, I'm unable to get it to return any results when I search.  Any ideas?
0 Kudos