Update API breaks the Terms facet

Hi,

Elastic Search Version: 0.19.8

I have run into a strange problem after using the update API to add a new
nested field to an existing index. The update went through fine and I can
query the index using the newly added field. However, if I try to run a
terms facet on the new field, no results are returned and the "missing"
attribute is set to the total number of documents in the index. When I
look at the source, the data actually exists - so there is no reason for it
to be marked as missing.
Has anybody else encountered this before? Here's a gist that recreates the
issue: https://gist.github.com/4338257

Thanks in advance.

--

Hi,

If you facet want to facet on nested properties you need to specify in
the facet request part. In your case if you add the following to the
p facet:
"nested" : "nested_impression"

Also a refresh needs to have happened after the updates have been
completed. By default this happens every second.
When I ran your gist I added a call to the refresh api. The search
result is now as expected. See my gist:

Martijn

On 19 December 2012 18:14, Charith *@otiose.me wrote:

Hi,

Elastic Search Version: 0.19.8

I have run into a strange problem after using the update API to add a new
nested field to an existing index. The update went through fine and I can
query the index using the newly added field. However, if I try to run a
terms facet on the new field, no results are returned and the "missing"
attribute is set to the total number of documents in the index. When I look
at the source, the data actually exists - so there is no reason for it to be
marked as missing.
Has anybody else encountered this before? Here's a gist that recreates the
issue: Elastic Search Terms Facet Weirdness · GitHub

Thanks in advance.

--

--
Met vriendelijke groet,

Martijn van Groningen

--

Wow, thanks so much Martijn. It never occurred to me to do a nested facet
because all my other nested fields had "include_in_root" set to true. I
feel very stupid now.

Thanks once again.

On Wednesday, 19 December 2012 21:25:58 UTC, Martijn v Groningen wrote:

Hi,

If you facet want to facet on nested properties you need to specify in
the facet request part. In your case if you add the following to the
p facet:
"nested" : "nested_impression"

Also a refresh needs to have happened after the updates have been
completed. By default this happens every second.
When I ran your gist I added a call to the refresh api. The search
result is now as expected. See my gist:
gist:4340646 · GitHub

Martijn

On 19 December 2012 18:14, Charith *@otiose.me wrote:

Hi,

Elastic Search Version: 0.19.8

I have run into a strange problem after using the update API to add a
new
nested field to an existing index. The update went through fine and I
can
query the index using the newly added field. However, if I try to run a
terms facet on the new field, no results are returned and the "missing"
attribute is set to the total number of documents in the index. When I
look
at the source, the data actually exists - so there is no reason for it
to be
marked as missing.
Has anybody else encountered this before? Here's a gist that recreates
the
issue: Elastic Search Terms Facet Weirdness · GitHub

Thanks in advance.

--

--
Met vriendelijke groet,

Martijn van Groningen

--

No worries :slight_smile:

On 20 December 2012 09:39, Charith *@otiose.me wrote:

Wow, thanks so much Martijn. It never occurred to me to do a nested facet
because all my other nested fields had "include_in_root" set to true. I feel
very stupid now.

Thanks once again.

On Wednesday, 19 December 2012 21:25:58 UTC, Martijn v Groningen wrote:

Hi,

If you facet want to facet on nested properties you need to specify in
the facet request part. In your case if you add the following to the
p facet:
"nested" : "nested_impression"

Also a refresh needs to have happened after the updates have been
completed. By default this happens every second.
When I ran your gist I added a call to the refresh api. The search
result is now as expected. See my gist:
gist:4340646 · GitHub

Martijn

On 19 December 2012 18:14, Charith *@otiose.me wrote:

Hi,

Elastic Search Version: 0.19.8

I have run into a strange problem after using the update API to add a
new
nested field to an existing index. The update went through fine and I
can
query the index using the newly added field. However, if I try to run a
terms facet on the new field, no results are returned and the "missing"
attribute is set to the total number of documents in the index. When I
look
at the source, the data actually exists - so there is no reason for it
to be
marked as missing.
Has anybody else encountered this before? Here's a gist that recreates
the
issue: Elastic Search Terms Facet Weirdness · GitHub

Thanks in advance.

--

--
Met vriendelijke groet,

Martijn van Groningen

--
Met vriendelijke groet,

Martijn van Groningen

--