Use array in wildcard field in query


I have an array of selected modules, called selectedModules that contains the names of the selected modules.
Now, I want to search my Elasticsearch Index for sources that begin with either of the selected modules, like so:

    'query': {
        'bool': {
            'must': [{
                    'wildcard': {
                      "source.keyword":  [selectedModules] +"*"
      here is some other irrelevant stuff

However, this is way I always receive an empty array as response, since it probably searches for documents' sources that begin with the whole array.

Thus, how can I search for elements of an array with the wildcard field via one query.



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