You are viewing limited content. For full access, please sign in.

Question

Question

search by 2 collection fields

asked on June 8, 2016 Show version history

my case is i have 2 collection fields and i choose from one of them the person and from the other collection the action for that person and add another person and action for him etc...... ,

so i need to search in all documents that have specific person with specific action . 

 

let's say the person is "Dany" and the action is "Follow up" how can i do that .

i Did something like that :

{[]:[Person]="Dany"} & {[]:[Action]="Follow up"}

 

but the problem is getting all documents with action of "Follow up" and dany exist even if he had a different action, and vice versa  all the dany even if he got different action .

0 0

Answer

SELECTED ANSWER
replied on June 8, 2016

Depending in how many values you expect to have, it may be feasible to use the indexing syntax to pair up the person and the action:

({[]:[Person](1)="Dany"} & {[]:[Action](1)="Follow up"}) | ({[]:[Person](2)="Dany"} & {[]:[Action](2)="Follow up"})

The above syntax says "Dany as the first value for Person and Followup as the first value for Action, OR Dany as the second value for Person and Followup as the second value for Action". You can add a term for each position if you'll only have a couple values for each.

1 0

Replies

replied on June 8, 2016

Give this a shot and it should work as expected.  {[]:[Person]="Dany", [Action]="Follow up"}  To get your search syntax, the easiest way to form the statement is to perform the search using the LF Client and enable or show the search syntax box.  Once you have formed the search as desired, you can simply copy and paste the syntax from the Client to the Workflow search dialogue box.

1 0
replied on June 8, 2016 Show version history

the problem not in the syntax . the problem that is the result not as i expected . as i said i need only to show documents  that have Dany with follow up action

i tried your syntax and it's the same result.

0 0
replied on June 8, 2016 Show version history

Using both syntaxes (yours and Glenn's) mentioned in this post, I successfully returned only documents that contained both "Person field=Dany" and "Action=Follow Up".

What were the other results were you returning that were not expected, what metadata did it contain? What type of fields are Person and Action? Are they multivalue fields? Also, what did you mean by "collection field"?

0 0
replied on June 8, 2016

sorry for the misunderstanding i meant multivalued field

for example there is a document with these values

Person         Action

"David"       "For you information"

 "Ally"          "Follow Up"

 

- in that case, the search syntax will bring this documents because it has

"Follow Up" and "David". this my problem . i need to get only the document that has david with the action "Follow up" . is that possible.

 

0 0
SELECTED ANSWER
replied on June 8, 2016

Depending in how many values you expect to have, it may be feasible to use the indexing syntax to pair up the person and the action:

({[]:[Person](1)="Dany"} & {[]:[Action](1)="Follow up"}) | ({[]:[Person](2)="Dany"} & {[]:[Action](2)="Follow up"})

The above syntax says "Dany as the first value for Person and Followup as the first value for Action, OR Dany as the second value for Person and Followup as the second value for Action". You can add a term for each position if you'll only have a couple values for each.

1 0
replied on June 8, 2016

this is great it helped me a lot , i didn't know that you can add an index in the search. 

0 0
replied on June 9, 2016

If you want more information on the search syntax, you can check out the presentation and handout for LDEV202: Search Syntax (from Empower 2016) and the tech paper on search syntax.

0 0
replied on June 12, 2016

Thank you

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.