0

I want to execute this sql query in java api for get elastic search data -

 select mime_type,count(*),sum(original_size) 
 from explore_object_metadata 
 group by mime_type;

I am able to get the data from elastic search for the following sql query -

select mimetype,count(*) 
from table 
group by mimetype

By the code in following link - elastic search aggregation in java for all indexes in elastic search

How I get this.

1

2 Answers 2

1

You should use aggregations for this.

Sign up to request clarification or add additional context in comments.

Comments

0

I am using the ElasticSearch API to execute the CRUD request. the API can build JSON content with JAVA code.

Here is the official document for the API: https://www.elastic.co/blog/found-java-clients-for-elasticsearch

Here is the Maven config.

    <dependency>
        <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch</artifactId>
        <version>1.6.0</version>
    </dependency>

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.