elasticsearch - ES search query call and return only selected fields -


i'm trying write query elastic search return first 20 closest matches.

i want return first 20 matches title field.

curl -x post "localhost:9200/xxx/_search?pretty=true" -d ' { "from" : 0, "size" : 20, "query" : { "term" : {"title" : "art"} }}' 

what missing here?

update:

i'm trying 'title' field returned, not whole object.

i got doing search fields param:

curl -x post "localhost:9200/xxx/_search?pretty=true" -d ' { "from" : 0, "size" : 20, "fields" : ["title"], "query" : { "term" : {"title" : "art"} }}' 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -