# Collapse 2 levels

**URL:** https://forum.opensearch.org/t/collapse-2-levels/19670
**Category:** OpenSearch
**Created:** [June 3, 2024, 8:56am UTC](https://forum.opensearch.org/t/collapse-2-levels/19670 "2024-06-03T08:56:16Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Garance](https://avatars.discourse-cdn.com/v4/letter/g/c2a13f/32.png) [@Garance](https://forum.opensearch.org/u/Garance)
#### Post date: [June 3, 2024, 8:56am UTC](https://forum.opensearch.org/t/collapse-2-levels/19670/1 "2024-06-03T08:56:17Z")

</div>

**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**

```auto
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:

```auto
    "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** :
