Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
OpenSearch 2.14
Describe the issue:
I want to collapse search results and show the list of results on 2 levels, I tested the query parameter collapse and the collapse processor, I met some problems.
Query parameter collapse with inner_hits
POST /my_index/_search
{
  "query": {
    "match": {
      "title": "test collapse"
    }
  },
  "collapse": {
    "field": "document_type",
    "inner_hits": {
      "name": "Type",
      "size": 2,
      "_source": ["document_type"]
    }
  },
  "_source": ["document_type"],
  "size": 10
}
In the results the first document of the level 2 is always the same of its parent, how to avoid this duplication?
Collapse processor
I also tested the collapse processor, if I add response_processors.collapse.inner_hits in a pipeline:
    "inner_hits": {
      "name": "Type",
      "size": 2,
      "_source": ["document_type"]
    }
I get the error:
processor [collapse] doesn’t support one or more provided configuration parameters: [inner_hits]
How to collapse results on 2 levels with collapse processor?
Configuration:
Relevant Logs or Screenshots: