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
Open

Missing support for Field Collapsing? #1392

StefanGla opened this issue Oct 18, 2017 · 1 comment

Comments

@StefanGla
Copy link

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
Copy link
Owner

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 pushed 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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants