How to run more than one Scripts independently

Hi,

i would like to know how to have more than one script in same code, which i need to run them when the search match.

my code is (only script part, before i have the match part that is running ok)

   "script": {"source":"if ('"+`${param_marca}`+ "'!= '') {ctx._source.marca_possivel = '" +`${param_marca}`+"'} else {ctx.op = 'noop'} "
   },

   "script": {"source":"if ('"+`${param_modelo1}`+ "'!=  '') {ctx._source.modelo1_possivel = '" +`${param_modelo1}`+"'} else {ctx.op = 'noop'} "
   },

   "script": {"source":"if ('"+`${param_modelo2}`+ "'!=  '') {ctx._source.modelo2_possivel = '" +`${param_modelo2}`+"'} else {ctx.op = 'noop'} "
   },

   "script": {"source":"if ('"+`${param_modelo3}`+ "'!=  '') {ctx._source.modelo3_possivel = '" +`${param_modelo3}`+"'} else {ctx.op = 'noop'} "
   },

   "script": {"source":"if ('"+`${param_modelo4}`+ "'!=  '') {ctx._source.modelo4_possivel = '" +`${param_modelo4}`+"'} else {ctx.op = 'noop'} "
   },

   "script": {"source":"if ('"+`${param_modelo5}`+ "'!=  '') {ctx._source.modelo5_possivel = '" +`${param_modelo5}`+"'} else {ctx.op = 'noop'} "
    }

this code execute only the last script, and ignore the previous one.

Any friend to help me?

What api are you trying to run a script in? In general, only one script is meant to be consumed within each api that supports scripts.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.