Document in Search result, but can't get it using his id

Hi,

I having a weird issue. When I'm querying ElasticSearch, everything is
fine, all my documents are retrieved :

{
"took" : 1045,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 53065,
"max_score" : 5.1729774,
"hits" : [ {
"_index" : "twitter2",
"_type" : "tweet",
"_id" : "262393493719240704",
"_score" : 5.1729774, "_source" : {"retweeted":false,"source":"<a href="http://blackberry.com/twitter" rel="nofollow">Twitter for BlackBerry®","favorited":false,"coordinates":null,"place":null,"retweet_count":0,"entities":{"hashtags":[],"user_mentions":[],"urls":[]},"truncated":false,"created_at":"Sun Oct 28 03:20:58 +0000 2012","in_reply_to_status_id_str":null,"contributors":null,"text":"Paris! Paris! Paris Saint-Germain!","user":{"friends_count":"141","follow_request_sent":null,"profile_image_url":"http://a0.twimg.com/profile_images/2243028690/IMG-20120521-00134_normal.jpg","profile_sidebar_fill_color":"DDEEF6","profile_background_image_url_https":"https://si0.twimg.com/profile_background_images/560433165/6518-creepy-owl.jpg","profile_background_color":"C0DEED","notifications":null,"url":null,"id":"569084775","following":null,"is_translator":false,"screen_name":"Tantooowi","lang":"id","location":"","followers_count":"162","statuses_count":"1973","name":"Fransiskus Tanto","description":"Life isn't about finding yourself. Life's about creating yourself. De Britto College, YK 0'13","favourites_count":"0","profile_background_tile":true,"listed_count":0,"profile_link_color":"0084B4","contributors_enabled":false,"profile_image_url_https":"https://si0.twimg.com/profile_images/2243028690/IMG-20120521-00134_normal.jpg","profile_sidebar_border_color":"C0DEED","created_at":"Wed May 02 10:50:24 +0000 2012","utc_offset":25200,"verified":false,"profile_background_image_url":"http://a0.twimg.com/profile_background_images/560433165/6518-creepy-owl.jpg","default_profile":false,"protected":false,"id_str":"569084775","profile_text_color":"333333","default_profile_image":false,"time_zone":"Bangkok","profile_use_background_image":true,"geo_enabled":false},"in_reply_to_user_id":null,"id":"262393493719240704","in_reply_to_status_id":null,"geo":null,"in_reply_to_user_id_str":null,"id_str":"262393493719240704","in_reply_to_screen_name":null}
},

But when i'm trying to get only one id, i got

{"_index":"twitter2","_type":"tweet","_id":"262393493719240704","exists":false}

Do you have any idea ? I tried on all my nodes, but there is no way i can
get this tweet back with his id.

--

To add to my previous message, not of all tweets can't be retrieved by id.
It seems to be random.
I also checked my mapping, everything should be stored
: https://gist.github.com/4048019
Also no error in logs.

  • Loïc

--

If you require only access to one document by id, you should use the GET
API since it is near-realtime.

curl -XGET 'http://localhost:9200/twitter2/tweet/262393493719240704'

Was the tweet just indexed? In the document that is returned by the above
query, there is an "id" field. Can you query against "id" and not "_id"? I
have never tried to query against the _id field, mainly because it is a bad
practice in Lucene, but I believe it should be indexed.

--

Ivan

On Fri, Nov 9, 2012 at 12:27 PM, Loïc Bertron loic.bertron@gmail.comwrote:

To add to my previous message, not of all tweets can't be retrieved by id.
It seems to be random.
I also checked my mapping, everything should be stored :
Twitter Mapping · GitHub
Also no error in logs.

  • Loïc

--

--

That sounds like a routing issues. Did you specify a routing value when
tweets were indexed? If yes, then the same routing value should be
specified with get request.

On Friday, November 9, 2012 3:27:40 PM UTC-5, Loïc Bertron wrote:

To add to my previous message, not of all tweets can't be retrieved by id.
It seems to be random.
I also checked my mapping, everything should be stored :
Twitter Mapping · GitHub
Also no error in logs.

  • Loïc

--