Search query for document with nested objects

Hi!
Help please form an index structure and / or write a search query

i have about such mapping

{
    "doc": {
        "mappings": {
            "base": {
                "properties": {
                     ...,

                    "messages": {
                        "type": "nested",
                        "properties": {
                            ...,
                            "author_id": {
                                "type": "string",
                                "index": "not_analyzed"
                            }
                            ...
                        }
                    }
                }
            }
        }
    }

I want write query, that returns me all documents if any of messages.author_id matches the requested

my query:

{
  "query": {
    "nested": {
      "path": "messages",
      "query": {
        "match": {
          "messages.author_id": "7781bb00-312f-4db1-93cf-e8d178517762"
        }
      }
    }
  }
}

but this query returns documents with ALL "messages.author_id": "7781bb00-312f-4db1-93cf-e8d178517762" but i want any of "messages.author_id": "7781bb00-312f-4db1-93cf-e8d178517762"

How can i do?

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