[scripting score] quick way to see if a value is or is not in a field of a type array

Hi guys,

I have objects with 3 fields of type array containing a large amount of

these integers are mutually excluded between fields = if an integer is in
the field1, it can't be in the field2 or field3, and vise-versa

for instance

object_1: {
field1: [1,4,5,8],
field2: [2,6,7,11],
field3: [3,9,10]

object_2: {
field1: [1],
field2: [3, 2, 4],
field3: [10,7]

since each field have a different importance (field1> field2> field3). I
would to create a custom script scoring according the field in which the
integer 6 is (for instance), like the following

if field1 has the integer 6 => score 2
if field2 has the integer 6 => score 1
if field3 has the integer 6 => score 0.5

How to effectively do that in scripting ?

I would like to avoid interating since the fields/arrays of some objects
are very large (100K)

( boosting differently each field can be used to pre ranking the objects
and retrieve the top N, but I need a more complex custom score as

Thanks in advance !


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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/bcca4bf6-58ab-4ab6-9bc7-23aa58752120%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.