Query on Id field of nested documents fails


(dazraf) #1

Hi,

Very grateful for any help with the following (rather urgent) issue.
Gist: https://gist.github.com/dazraf/55ebb900b3c17583bf58

The script clears the indices and sets up dynamic mapping so that all child
documents are treated as nested.
Then there are two queries on fields of
message.statistics.timings.measure.thing.
The first, on uniqueThing field succeeds.
The second on the id field fails with zero documents.

Not sure why the second query is failing to locate any documents.

Any help much appreciated!

thanks
Fuzz.

--
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/0397e742-d483-45aa-a4db-da300416d9da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(dazraf) #2

Hi,

Could anyone help please? We're kind of stuck right now - trying to get to
a point that we demonstrate ES working for our use-cases to get management
blessing.

thanks
Fuzz.

On Tuesday, 24 June 2014 14:43:01 UTC+1, dazraf wrote:

Hi,

Very grateful for any help with the following (rather urgent) issue.
Gist: https://gist.github.com/dazraf/55ebb900b3c17583bf58

The script clears the indices and sets up dynamic mapping so that all
child documents are treated as nested.
Then there are two queries on fields of
message.statistics.timings.measure.thing.
The first, on uniqueThing field succeeds.
The second on the id field fails with zero documents.

Not sure why the second query is failing to locate any documents.

Any help much appreciated!

thanks
Fuzz.

--
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/74ca426d-05ae-4f2c-bf55-738b4669e752%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(dazraf) #3

Is this related to this issue?

On Tuesday, 24 June 2014 14:43:01 UTC+1, dazraf wrote:

Hi,

Very grateful for any help with the following (rather urgent) issue.
Gist: https://gist.github.com/dazraf/55ebb900b3c17583bf58

The script clears the indices and sets up dynamic mapping so that all
child documents are treated as nested.
Then there are two queries on fields of
message.statistics.timings.measure.thing.
The first, on uniqueThing field succeeds.
The second on the id field fails with zero documents.

Not sure why the second query is failing to locate any documents.

Any help much appreciated!

thanks
Fuzz.

--
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/14de51ef-8569-476b-9495-edd2c4967837%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Ivan Brusic) #4

It is not related to that issue. In that issue, your query would work, but
all the nested documents are returned, not just the relevant.

It seems like the query fails on fields named "id". If you rename that
field, the query works, so it has nothing to do with your mapping. I would
report it as a bug or use another field name.

--
Ivan

On Thu, Jun 26, 2014 at 9:29 AM, dazraf farzad.pezeshkpour@gmail.com
wrote:

Is this related to this issue?
https://github.com/elasticsearch/elasticsearch/issues/3022

On Tuesday, 24 June 2014 14:43:01 UTC+1, dazraf wrote:

Hi,

Very grateful for any help with the following (rather urgent) issue.
Gist: https://gist.github.com/dazraf/55ebb900b3c17583bf58

The script clears the indices and sets up dynamic mapping so that all
child documents are treated as nested.
Then there are two queries on fields of
message.statistics.timings.measure.thing.
The first, on uniqueThing field succeeds.
The second on the id field fails with zero documents.

Not sure why the second query is failing to locate any documents.

Any help much appreciated!

thanks
Fuzz.

--
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/14de51ef-8569-476b-9495-edd2c4967837%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/14de51ef-8569-476b-9495-edd2c4967837%40googlegroups.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/CALY%3DcQCjSKdgk%3D--P9UGzN06TjQ%3DbePyWUneCdALGos2DehbGQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(dazraf) #5

Hi Ivan,

Thanks very much for the response! It's great to know you're able to
reproduce the use-case.

Although one can always write custom mappings or change the client, our aim
is to:

  1. Avoid using schema-specific mappings; and
  2. Avoid forcing the clients with any schema constraints

Querying/filtering by a nested "id" field should be supported as any other
field I think - seeing that the documents do not preclude this use.
Therefore, perhaps its reasonable to raise a bug report and see it fixed.
Would you agree?

many thanks and kind regards,

Fuzz.

On Friday, 27 June 2014 21:16:24 UTC+1, Ivan Brusic wrote:

It is not related to that issue. In that issue, your query would work, but
all the nested documents are returned, not just the relevant.

It seems like the query fails on fields named "id". If you rename that
field, the query works, so it has nothing to do with your mapping. I would
report it as a bug or use another field name.

--
Ivan

On Thu, Jun 26, 2014 at 9:29 AM, dazraf <farzad.pe...@gmail.com
<javascript:>> wrote:

Is this related to this issue?
https://github.com/elasticsearch/elasticsearch/issues/3022

On Tuesday, 24 June 2014 14:43:01 UTC+1, dazraf wrote:

Hi,

Very grateful for any help with the following (rather urgent) issue.
Gist: https://gist.github.com/dazraf/55ebb900b3c17583bf58

The script clears the indices and sets up dynamic mapping so that all
child documents are treated as nested.
Then there are two queries on fields of
message.statistics.timings.measure.thing.
The first, on uniqueThing field succeeds.
The second on the id field fails with zero documents.

Not sure why the second query is failing to locate any documents.

Any help much appreciated!

thanks
Fuzz.

--
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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/14de51ef-8569-476b-9495-edd2c4967837%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/14de51ef-8569-476b-9495-edd2c4967837%40googlegroups.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/560a3ed9-58e9-4861-92e6-ce1709b43275%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #6