Thanks for the prompt reply.

For the mapping, it's a "long". Here are the output
{
   "my_index": {
      "my_type": {
         "id": {
            "full_name": "id",
            "mapping": {
               "id": {
                  "type": "long"
               }
            }
         }
      }
   }
}

After I do further investigation, it seems that the error is caused by Sense 
Chrome 
plugin<https://chrome.google.com/webstore/detail/sense/doinijnbnggojdlcjifpdckfokbbfpbo>that
 I use. So, what I did now is I index a document that has an id field 
equals to "427478922591096833". When we use obtain this document, the Sense 
will show the id equals to "427478922591096800". But, I managed to get the 
correct result when using curl. 

So yesterday problem is because I used the id (which is the invalid id, 
i.e. 427478922591096800) returned by Sense to perform the search and the 
search return nothing. When I use the search using the correct id from 
curl, I managed to get the document. 

If you're interested, you can take a look at the Sense screenshot which 
highlight the problem in my note: 
https://www.evernote.com/shard/s115/sh/a82222fb-952a-4fc0-a81c-2d88c1e2bdb1/bd80a433dfdf0ccb51dd8d35cd827838

Best regards, 

Arinto



On Friday, February 14, 2014 7:23:27 AM UTC+8, Adrien Grand wrote:
>
> Can you check that this field is actually mapped as a long (as opposed to 
> an integer or double) using the get field mapping API? 
> http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-get-field-mapping.html
>
> Since 433036615015882750 requires 59 bits to be stored, it can actually 
> only be stored as a long (64 bits). Neither an integer (32 bits) nor a 
> double (52 bits) would be able to store it and it would prevent you from 
> searching this document.
>
>
> On Thu, Feb 13, 2014 at 9:05 AM, Arinto Murdopo <[email protected]<javascript:>
> > wrote:
>
>> Hi there, 
>>
>> Suppose I have this document:
>> {
>>   "user": {
>>     "uid": 67483951,
>>   },
>>   "did": 433036615015882750
>> }
>>
>>
>> "uid" and "did" have type of "long" in the mapping.
>> Its document id is unknown and I would like to fetch the document using 
>> "did" value via search API.
>> Therefore, I issue this curl command:
>>
>> curl -XGET "
>> http://eshost:9200/my_index/my_type/_search?q=did:433036615015882750";
>>
>> Unfortunately, the above curl command is unable to fetch my document. 
>> Here is the result from the curl command:
>> {
>>    "took": 46,
>>    "timed_out": false,
>>    "_shards": {
>>       "total": 20,
>>       "successful": 20,
>>       "failed": 0
>>    },
>>    "hits": {
>>       "total": 0,
>>       "max_score": null,
>>       "hits": []
>>    }
>> }
>>
>>  However, when I use the "uid" to search, I'm able to fetch the document. 
>> Here's the curl command for search using "uid"
>>
>> curl -XGET "
>> http://eshost:9200/my_index/my_type/_search?q=user.uid:67483951";
>>
>> I tried above with using Java API (using prepareSearch method of 
>> transport client, with term query), but the results are the same i.e. I can 
>> fetch using "uid" but I can't fetch using "did". So, the question is how to 
>> search using large value of "long" as shown in this case?
>>  
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "elasticsearch" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/elasticsearch/9bc36672-cdcb-4edf-ae04-9bfaa49e7cca%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> -- 
> Adrien Grand
>  

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/acb0e42a-e967-401e-9644-398e88e37317%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to