Search code examples
twitterelasticsearchlogstashquerydsl

ElasticSearch, can't find my object after update it


I have an ElasticSearch with some tweets.

When I update one field of a specific tweet:

curl -XPOST "localhost:9200/twitter/tweet/AVUvNhBBGGUJjR2EAFix/_update" -d '
{ 
  "script": "ctx._source.retweet_count += 5"
}'

I've got a success:

{"_index":"twitter","_type":"tweet","_id":"AVUvNhBBGGUJjR2EAFix","_version":4,"_shards":{"total":2,"successful":1,"failed":0}}

I can check my updated object with:

curl -XGET "localhost:9200/twitter/tweet/AVUvNhBBGGUJjR2EAFix/_source"

But when I try to get all the tweets from my ElasticSearch:

curl -XGET "localhost:9200/twitter/tweet/_search" -d '{ "query": {"match_all": {}}}'

I can't find my updated object.

What I'm doing wrong ?


Solution

  • Ok,

    _search show you 10 results by default. I simply used the size parameter to show all my results:

    curl -XGET "localhost:9200/twitter/tweet/_search?pretty=true&size=58" -d '{ "query": {"match_all": {}}}'
    

    Hope that could help.