Find Operation Multiple Search Text Values

2687
1
Jump to solution
07-09-2013 06:24 AM
ChristopherBlinn1
Occasional Contributor III
Hello All,

Is it possible to have multiple searchText values in a Find operation?

I would like to search for the occurrence of string1 AND string2 AND ... stringN in a series of fields.

Example:

A user wants to search the value "John Smith".

The layer field has the name stored as "Smith, John".

I would like searchText=John&&Smith (or whatever supported operator exists to specify AND).

I can't seem to find any documentation or examples of anyone doing this so I am lead to presume it is not possible.

Also, I need to use the Find operator, and not a Query(where) so concat (||) fields and building a where statement is not an option.

Any help appreciated!

Thanks,
Chris B.
0 Kudos
1 Solution

Accepted Solutions
ChristopherBlinn1
Occasional Contributor III
I have solved this by applying a layer definition to the find operation that uses the SQL expression I need to find any matching values.

I split the string entry at each space, and make the search text the first element in the array (arr[0]).

Then I make the layer definition the SQL expression to find matches with the AND operator (field1||field2||field3 LIKE '%arr[0]%' AND field1||field2||field3 LIKE '%arr[1]%' ... AND field1||field2||field3 LIKE '%arr%')

It may not be the cleanest route, but it works like a charm.

Hope this helps anyone else out there looking to do something similar.

Best,
Chris B.

View solution in original post

0 Kudos
1 Reply
ChristopherBlinn1
Occasional Contributor III
I have solved this by applying a layer definition to the find operation that uses the SQL expression I need to find any matching values.

I split the string entry at each space, and make the search text the first element in the array (arr[0]).

Then I make the layer definition the SQL expression to find matches with the AND operator (field1||field2||field3 LIKE '%arr[0]%' AND field1||field2||field3 LIKE '%arr[1]%' ... AND field1||field2||field3 LIKE '%arr%')

It may not be the cleanest route, but it works like a charm.

Hope this helps anyone else out there looking to do something similar.

Best,
Chris B.
0 Kudos