Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing support for Field Collapsing? #1392

Open
StefanGla opened this issue Oct 18, 2017 · 1 comment

Comments

@StefanGla
Copy link

@StefanGla StefanGla commented Oct 18, 2017

Hello,
I wonder if the elastica package already supports field collapsing?

https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-request-collapse.html#search-request-collapse

If not, how can I add these collapse-parameters to my query?

@ruflin

This comment has been minimized.

Copy link
Owner

@ruflin ruflin commented Oct 20, 2017

@StefanGla You should be able to use setRawQuery to set the params: http://elastica.io/api/latest/classes/Elastica.Query.html#method_setRawQuery But it would be pretty nice to add support for it with functions.

ruflin added a commit that referenced this issue Aug 22, 2019
Added support for Field Collapsing as requested in #1392.
ES documentation: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html#request-body-search-collapse

Note: Inheriting `Query\InnerHits` in `Collapse\InnerHits` was something I've been debating with myself over and over again. As far as I'm concerned it makes sense to have different classes, especially as the collapse one has to have support for the second level collapse, but I didn't want to duplicate the entire code for InnerHits.
Downside is that right now there's no `AbstractCollapse` base-class as there is for the other concepts. Still feel like that's okay, because field collapsing is a quite simple concept right now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.