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

Can tantivy::collector::facet_collector::FacetCounts be exported to pub? #978

Closed
slckl opened this issue Feb 3, 2021 · 2 comments · Fixed by #979
Closed

Can tantivy::collector::facet_collector::FacetCounts be exported to pub? #978

slckl opened this issue Feb 3, 2021 · 2 comments · Fixed by #979

Comments

@slckl
Copy link
Contributor

slckl commented Feb 3, 2021

Sorry, if I'm missing something obvious here, but...

As a user of Tantivy as a library and using a FacetCollector, I'd like to write a function that takes in FacetCounts and process the results into something more fit for my application. Alas, the FacetCounts struct is not exported as public for users of Tantivy.
I can only process the facet counts inside the same function I obtain the results in. This approach works, but limits how I as a user can organize my code around FacetCounts.

Are there any downsides to this type being exported publicly? Maybe in the same tantivy::collector module?

@slckl
Copy link
Contributor Author

slckl commented Feb 4, 2021

An alternative could be to use MultiCollector, which returns MultiFruit, from which you can extract results for each collector using a handle. Alas, MultiFruit is also not exported publicly, so there goes that plan.

Going with processing in-place for now, but I still think it would be nice, if I could write a separate function for each collector separately.

@fulmicoton
Copy link
Collaborator

I am ok to make it pub. Can you for tantivy, make it pub on your fork, depend on your fork to check that it addresses your problem, and send a PR?

I'd hate to make it pub, and then realize it is not sufficient to fix your problem.

fulmicoton added a commit that referenced this issue Feb 5, 2021
FacetCounts are now pub use in tantivy::collector (Closes #978)
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

Successfully merging a pull request may close this issue.

2 participants