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

Top Hits Aggregation Usage #7

Closed
bertiepinnock opened this issue Feb 15, 2016 · 4 comments
Closed

Top Hits Aggregation Usage #7

bertiepinnock opened this issue Feb 15, 2016 · 4 comments
Assignees
Labels

Comments

@bertiepinnock
Copy link

Hi again,

When querying Elasticsearch with a Top Hits aggregation (using an aggregations data adapter), the plugin reads in the hits as a single field with a class type of org.elasticsearch.search.internal.InternalSearchHits. This prints out in the report as something like org.elasticsearch.search.internal.InternalSearchHits@524df193 rather than the actual contents of the hit.

Is there a way I'm missing to get the contents of the hit into the report?

Thanks very much!

@Wedjaa Wedjaa self-assigned this Feb 15, 2016
@Wedjaa
Copy link
Contributor

Wedjaa commented Feb 15, 2016

Hi bertiep,

will look into it.

@Wedjaa
Copy link
Contributor

Wedjaa commented Feb 15, 2016

Hi bertiep,

I'm closing this issue. I have seen what the confusion may have been for you - it's a common mistake - and I decided to write a blog entry that explains what is happening and how to properly insert aggregation results into a report.

You can find the article here: http://blog.wedjaa.net/unrolling-es-results/.

Cheers,

Fabio

@bertiepinnock
Copy link
Author

Thank you so much, that's fixed it!

Just a small thing, I think there's a typo in the blog post, I think the code snippet:
new net.sf.jasperreports.engine.JRBeanArrayDataSource($F{top_tag_hits Hits}.getHits())
Should be:
new net.sf.jasperreports.engine.data.JRBeanArrayDataSource($F{top_tag_hits Hits}.getHits())

Otherwise absolutely perfect, thank you very much again for the help!

@Wedjaa
Copy link
Contributor

Wedjaa commented Feb 16, 2016

Thanks for spotting the typo! Fixed it... it was a botched cut and paste.

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

2 participants