0

I'm new to Elasticsearch so, here is my doubt:

I have large data inserted into Elastic search. The data that I have inserted contains an attribute of marks of each subject, is it possible to write an Elasticsearch query to find the number of students who has their marks in the inputted range.

Example:

|studentname | maths | computers |
++++++++++++++++++++++++++++++++++
|s1          |78     |90         |
==================================
|s2          |56     |75         |
==================================
|s3          |45     |50         |
==================================

Assuming the data that is present in the ES in a tabular manner, is it possible to

1.Find the list of students who has scored more than 50 marks in computers.

2.Find the list of students who has scored more than 60 marks in both subjects.

1 Answer 1

1

Use range query :-

{  
   "query":{"bool":{"must":{"range":{computers:{gte: 50} }}}}
}

Check this link

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

7 Comments

can you be a bit more elaborate? About method type and URL request ?
Here computer type should be long or integer .URL - index/type/_search
do you have any idea how to make this request in java? or where can I go and read about it?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.