Multi _update_by_query API like MultiSearch _msearch - how to? possible?

Hi all,

I have following question regarding the multiple search api _msearch

Is there a way to do the same by using the _update_by_query api ?

UseCase: change entries of fields based on mutliple bool query like:

POST /myindex/_update_by_query
{
  "query" : {
    "bool" : {
      "filter" : {
        "terms" : {
          "Nr.keyword" : "12345"
        }
      }
    }
  },
    "script" : {
      "source" : "ctx._source.Wordcloud.keyword= 'Hallo'", 
      "lang"   : "painless"
      }
},
{
  "query" : {
    "bool" : {
      "filter" : {
        "terms" : {
          "Nr.keyword" : "67890"
        }
      }
    }
  },
    "script" : {
      "source" : "ctx._source.Wordcloud.keyword= 'Welt'", 
      "lang"   : "painless"
      }
},
{
  "query" : {
    "bool" : {
      "filter" : {
        "terms" : {
          "Nr.keyword" : "101112"
        }
      }
    }
  },
    "script" : {
      "source" : "ctx._source.Wordcloud.keyword= '!'", 
      "lang"   : "painless"
      }
} 

Thanks in advance for your suggestions

Regards

Hi @Datakids, are you able to find any solution for this problem.
Trying to achieve the same thing.

Hi,
no sorry, nothing you could use native inside ES
I go with python...
regards

There isn't a multi version. Update by query is already fairly expensive so it wouldn't usually be worth it, I think. If you can get by with a regular update operation then you can use the bulk api.

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