Get best entry/entries most likely using independent terms


I need to get the best entries when comparing strings to one field. For
example I have I field that are the people favourite colors.

Person 1 {Name:Ben; Age:30; Colors{Blue,Yellow,Black}}
Person 2 {Name:Linda; Age:10; Colors{Black,Green,White}}
Person 3 {Name:Clark; Age:22; Colors{Blue,Red,Purple}}
Person 4 {Name:Jerry; Age:20; Colors{Orange,Yellow,Grey}}

And I get Colors Blue and Yellow.
Expected results
Person 1 score 2
Person 4 score 1
Person 3 score 1
Person 2 score 0

I search foruns for this answer but I didn't found it, can anyone help me ?


You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit