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

Limit faceting to top N hits #2040

Closed
otisg opened this issue Jun 21, 2012 · 13 comments
Closed

Limit faceting to top N hits #2040

otisg opened this issue Jun 21, 2012 · 13 comments
Assignees
Labels

Comments

@otisg
Copy link

otisg commented Jun 21, 2012

See
https://groups.google.com/d/msg/elasticsearch/OZsc5ofNhag/9JfwSy-CEMwJ where Shay says "...with the design of the facets, if shouldn't be hard to implement..."

@tlrx
Copy link
Member

tlrx commented Jun 29, 2012

+1, I also need this feature

Can anyone point me to the class(es) or way to implement this? Thx

@jimdickinson
Copy link

+1

This feature would be really useful to me.

@otisg
Copy link
Author

otisg commented Sep 20, 2012

+1
Just spoke to a company using ES and they, too, would like this.

@ferdynice
Copy link

This would be very useful!

@loachli
Copy link

loachli commented Jan 24, 2013

+1, Save top k is enough

@fmaritato
Copy link

I have done some work on this since I need it for a project. I only implemented it for terms facets at the moment until I get some feedback on implementation. Can someone take a look at the diff of my fork and let me know if this is on the right track? https://github.com/fmaritato/elasticsearch/compare/issue2040

Essentially, I added a "num_results" parameter to the terms facet. The unit test I added uses the elasticsearch-test framework since it is easier and faster than the integration tests the project currently uses. I can take it out or switch it over if desired.

Thanks

@billoneil
Copy link

+1

@clintongormley
Copy link
Contributor

Closing in favour of #6876

@clintongormley
Copy link
Contributor

Actually, #6876 doesn't solve this. Please could I have some info about use cases here. Why do you need this feature?

@fmaritato
Copy link

The project I was working on was indexing shopping products from different providers who had inventory. I found when I was doing searches but only returning the first 25 items that the facets returning the brand names and counts reflected the entire search instead of what was being shown on the page. This often lead to a confusing user experience.

@clintongormley
Copy link
Contributor

I can see the usefulness of this option.

@markharwood
Copy link
Contributor

Related: I extended the significant_terms agg in #6796 to add sampling of top results from each shard. For that use case it was also beneficial to eliminate near-duplicates from the analysis because they tend to rank similarly in the results. Using elements of this implementation and the new "deferred" capability in the aggregations base class we could add a sampling capability that would apply to all child aggregations in a tree.

@markharwood
Copy link
Contributor

Closed in favour of #8108 which is now in master branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants