Pre Exam Test Practice (SSC | Banking | IAS | GATE | State Level | CLAT | Railways | Insurance | Teaching Exams | NDA | Defence | IES |State Exam )

Organizational Research By

Surprising Reserch Topic

Is there a way to get the number of hits for a filter without returning all the results of the filter?



using elastic-search, i am trying to use filters to count the number of links in two *****ociated models.

i have questions which has_many votes.

i have a mapping for votes, which indexes question id of each vote, and am doing

curl -xget localhost:9200/votes/_search -d '{query : {"constant_score" : {"filter" : { "term" : {"question_id" : 5} }, "boost" : 1.0 } }}'

the problem is that this returns all the results. is it possible to simply grab a count instead?

asked May 16, 2015 in SOLR by rajesh
0 votes

Related Hot Questions

Government Jobs Opening