State of the "collapse" feature of search

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
OpenSearch 2

Describe the issue:
The “collapse” feature is undocumented in OpenSearch 2. I see that it works with a basic test, but given that it is missing from the documentation (compared to Elasticsearch 7 Collapse search results | Elasticsearch Guide [7.17] | Elastic) and is missing from the opensearch-go client library as well as a couple other ones that I looked at, I’m reluctant to use it for fear of using an unsupported feature and running into undefined behavior or issues that won’t be resolved.

Can you please comment on the state of this feature - is it officially supported? Is the missing documentation and inclusion in the client libraries just an oversight? Is it being softly deprecated?

What would you recommend using as a result? I did some exploration and found that I can achieve something similar using the top_hits aggregation (Metric aggregations - OpenSearch documentation) but the shape of the response is significantly different so it’s not a direct replacement.

Any other suggestions?


Hey @jeffcs

I just used it in my lab, didnt notice anything unusual about execute it.

I also looked in the documentation, did not find any refernce about it.

I wouldn’t make a correlation between something that’s not in the documentation and it not being supported. I’m not in the position to provide an official answer, but my experience is that docs eventually catch up with a lot of things.

The collapse feature hasn’t gone anywhere.

It just hasn’t been documented as an OpenSearch feature yet. It hasn’t seen any active development recently (since it continues to “just work”), but people are creating feature requests and we are looking at making improvements (see e.g. Support field collapsing + rescore · Issue #7484 · opensearch-project/OpenSearch · GitHub).