Select to view content in your preferred language

FindParameters.searchText wild card?

3255
6
12-10-2010 11:38 AM
PaulSchneider
Regular Contributor
I'm having success with the FindParameters class, but am finding a limitation in what I am able to use for the .searchText property.

For instance:
findParams.searchText = "John Smith" //does NOT find a value of 'John A Smith'

Is there a wild card character or operator syntax that I could add that would return a result as such?

Maybe something like...
findParams.searchText = "John%%Smith" or
findParams.searchText = "John AND Smith"

Thanks-
Tags (2)
0 Kudos
6 Replies
SandeepKapadia
Emerging Contributor
Did you find a solution for your issue? I'm facing similar situation.
0 Kudos
BjornSvensson
Esri Regular Contributor
Is there a wild card character or operator syntax that I could add that would ... Maybe something like...
findParams.searchText = "John%%Smith" or
findParams.searchText = "John AND Smith"


No, "Find" does not support wildcards within search strings like that.  You would have to use Query.  Though remember that Find works on a MapService and Query on individual layers.
0 Kudos
SandeepKapadia
Emerging Contributor
Thank you.

I have a different question, Can I search on different fields in a single query? Meaning, search for field1 = 'Value1', field2 = 'Value2', etc?

findParameters.SearchFields.AddRange( new string[] {field1, field2});
findParameters.SearchText = Value123;

But I need to search multiple values, how can I do that?

Sandeep
0 Kudos
BjornSvensson
Esri Regular Contributor
Can I search on different fields in a single query? Meaning, search for field1 = 'Value1', field2 = 'Value2', etc?
...
But I need to search multiple values, how can I do that?


You can search for the same string in multiple fields using "Find" but I don't think that is what you are aiming for.

To search for multiple strings you either send multiple "Find" requests, or you can send a single "Query" (if it's only on one layer).
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/tasks/supportClasses/Query.html
0 Kudos
aubinmaynard
Deactivated User
I'm stumbling through learning coding, and need to do such a multiple search.  Any chance I can see a complete example of some working code using the query function?


Thanks,

A

You can search for the same string in multiple fields using "Find" but I don't think that is what you are aiming for.

To search for multiple strings you either send multiple "Find" requests, or you can send a single "Query" (if it's only on one layer).
http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/tasks/supportClasses/Query.html
0 Kudos
MichaelVolz
Esteemed Contributor
Does this wildcard limitation still exist with the Find Task?
0 Kudos