Term query on long type failing

Hi ,

I am extracting tweets from twitter and i found the following issue.
On doing a terms facet on field retweet.id , i received some user ID's.
Now on doing a term query on one of the value obtained , I am not getting
any result.

The facet is as following -
{
"facets": {
"terms": {
"terms": {
"field": "retweet.id",
"size": 10,
"order": "count",
"exclude": []
}
}
I received value 524145031945877919 using the faceting over field retweet.id
as the top first.

facets: {

  • terms: {
    • _type: terms
    • missing: 1251
    • total: 1213
    • other: 984
    • terms: [
      • {
        • term: 524145031945877919
        • count: 53
          }
      • {

Now i executed the following -

{
"query" : {
"term" : {
"retweet.id" : 524145031945877919
}
}
}
Its giving me 0 results.

Kindly point out , what is the issue.

Thanks
Vineeth

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nnjxV-_DpVKg1Ewcuq7wxrDsg48fkdo5OA92jENy9d2Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hi,

The term query aims at querying documents based on the raw bytes of a term.
It is not aware of your field mappings while numeric terms are not encoded
verbatim: they use a special binary encoding that allows the binary
representation of the numbers to be sortable lexicographically. Switching
to the match[1] query instead of term should fix the issue.

[1]
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-match-query.html

On Mon, Oct 20, 2014 at 1:40 PM, vineeth mohan vm.vineethmohan@gmail.com
wrote:

Hi ,

I am extracting tweets from twitter and i found the following issue.
On doing a terms facet on field retweet.id , i received some user ID's.
Now on doing a term query on one of the value obtained , I am not getting
any result.

The facet is as following -
{
"facets": {
"terms": {
"terms": {
"field": "retweet.id",
"size": 10,
"order": "count",
"exclude": []
}
}
I received value 524145031945877919 using the faceting over field
retweet.id as the top first.

facets: {

  • terms: {
    • _type: terms
    • missing: 1251
    • total: 1213
    • other: 984
    • terms: [
      • {
        • term: 524145031945877919
        • count: 53
          }
      • {

Now i executed the following -

{
"query" : {
"term" : {
"retweet.id" : 524145031945877919
}
}
}
Its giving me 0 results.

Kindly point out , what is the issue.

Thanks
Vineeth

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nnjxV-_DpVKg1Ewcuq7wxrDsg48fkdo5OA92jENy9d2Q%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nnjxV-_DpVKg1Ewcuq7wxrDsg48fkdo5OA92jENy9d2Q%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j5KNUhw%2BGSP_N1ZSWZWisGFHbmgTNz2YE10QMJDBXtq4Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hello Adrien ,

Thanks for your reply.

But match query is also not working for me -

{
"query": {
"match": {
"retweet.id": 524120494964535300
}
}
}

Gives 0 results.

Thanks
Vineeth

On Mon, Oct 20, 2014 at 5:50 PM, Adrien Grand <
adrien.grand@elasticsearch.com> wrote:

Hi,

The term query aims at querying documents based on the raw bytes of a
term. It is not aware of your field mappings while numeric terms are not
encoded verbatim: they use a special binary encoding that allows the binary
representation of the numbers to be sortable lexicographically. Switching
to the match[1] query instead of term should fix the issue.

[1]
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-match-query.html

On Mon, Oct 20, 2014 at 1:40 PM, vineeth mohan vm.vineethmohan@gmail.com
wrote:

Hi ,

I am extracting tweets from twitter and i found the following issue.
On doing a terms facet on field retweet.id , i received some user ID's.
Now on doing a term query on one of the value obtained , I am not getting
any result.

The facet is as following -
{
"facets": {
"terms": {
"terms": {
"field": "retweet.id",
"size": 10,
"order": "count",
"exclude": []
}
}
I received value 524145031945877919 using the faceting over field
retweet.id as the top first.

facets: {

  • terms: {
    • _type: terms
    • missing: 1251
    • total: 1213
    • other: 984
    • terms: [
      • {
        • term: 524145031945877919
        • count: 53
          }
      • {

Now i executed the following -

{
"query" : {
"term" : {
"retweet.id" : 524145031945877919
}
}
}
Its giving me 0 results.

Kindly point out , what is the issue.

Thanks
Vineeth

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nnjxV-_DpVKg1Ewcuq7wxrDsg48fkdo5OA92jENy9d2Q%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nnjxV-_DpVKg1Ewcuq7wxrDsg48fkdo5OA92jENy9d2Q%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j5KNUhw%2BGSP_N1ZSWZWisGFHbmgTNz2YE10QMJDBXtq4Q%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j5KNUhw%2BGSP_N1ZSWZWisGFHbmgTNz2YE10QMJDBXtq4Q%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nf6rSd5AJKDnhfS2mGu0tRQJUzQ__QWhf3AoRBotWrUg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Your retweet ids are close to the maximum double value. Can you check that
your retweet ids are actually mapped as longs (not double) and try to
reproduce from the command line with curl (instead of say from a browser or
any programming language since some of them would store all numbers as
doubles)?

On Mon, Oct 20, 2014 at 2:54 PM, vineeth mohan vm.vineethmohan@gmail.com
wrote:

Hello Adrien ,

Thanks for your reply.

But match query is also not working for me -

{
"query": {
"match": {
"retweet.id": 524120494964535300
}
}
}

Gives 0 results.

Thanks
Vineeth

On Mon, Oct 20, 2014 at 5:50 PM, Adrien Grand <
adrien.grand@elasticsearch.com> wrote:

Hi,

The term query aims at querying documents based on the raw bytes of a
term. It is not aware of your field mappings while numeric terms are not
encoded verbatim: they use a special binary encoding that allows the binary
representation of the numbers to be sortable lexicographically. Switching
to the match[1] query instead of term should fix the issue.

[1]
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-match-query.html

On Mon, Oct 20, 2014 at 1:40 PM, vineeth mohan <vm.vineethmohan@gmail.com

wrote:

Hi ,

I am extracting tweets from twitter and i found the following issue.
On doing a terms facet on field retweet.id , i received some user ID's.
Now on doing a term query on one of the value obtained , I am not
getting any result.

The facet is as following -
{
"facets": {
"terms": {
"terms": {
"field": "retweet.id",
"size": 10,
"order": "count",
"exclude": []
}
}
I received value 524145031945877919 using the faceting over field
retweet.id as the top first.

facets: {

  • terms: {
    • _type: terms
    • missing: 1251
    • total: 1213
    • other: 984
    • terms: [
      • {
        • term: 524145031945877919
        • count: 53
          }
      • {

Now i executed the following -

{
"query" : {
"term" : {
"retweet.id" : 524145031945877919
}
}
}
Its giving me 0 results.

Kindly point out , what is the issue.

Thanks
Vineeth

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nnjxV-_DpVKg1Ewcuq7wxrDsg48fkdo5OA92jENy9d2Q%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nnjxV-_DpVKg1Ewcuq7wxrDsg48fkdo5OA92jENy9d2Q%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j5KNUhw%2BGSP_N1ZSWZWisGFHbmgTNz2YE10QMJDBXtq4Q%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j5KNUhw%2BGSP_N1ZSWZWisGFHbmgTNz2YE10QMJDBXtq4Q%40mail.gmail.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nf6rSd5AJKDnhfS2mGu0tRQJUzQ__QWhf3AoRBotWrUg%40mail.gmail.com
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5nf6rSd5AJKDnhfS2mGu0tRQJUzQ__QWhf3AoRBotWrUg%40mail.gmail.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAL6Z4j5hQ984sr4q%2B0cPi5HkMfHZcZ1r%2BuBXO3wJ%2BiXQ-J854A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.