BTW: If I just remove the "type":"nested" from the mapping, the doc count
then is correct after insert one document.
Anyone has suggestions resolve this issue?
On Thursday, April 16, 2015 at 5:36:04 PM UTC+8, Xudong You wrote:
I was confused by the docs count value displaying in head plugin if there
is nest type field define in mapping
For example, I created a new index with following mapping:
{
"mappings" : {
"doc" : {
"properties" : {
"QueryClicks" : {
"type" : "nested",
"properties" : {
"Count" : {
"type" : "long"
},
"Term" : {
"type" : "string"
}
}
},
"Title" : {
"type" : "string"
}
}
}
}
}
And then insert ONE doc:
{
"QueryClicks":[{"Term":"term1","Count":10},{"Term":"term2","Count":10}],
"Title":"test title"
}
Then refresh Head, the docs shown on Head is 3:
size: 3.57ki (6.97ki)
docs: 3 (3)
Just figured out that the doc count is actually the number of document +
the number of items of nested field, in my case, the QueryClicks field has
two items, then the total number of doc shown on head is 1+2=3.
But this might confuse the people who view doc counts on head or other UI
plug-in.
Is there anyway let head just show the doc count, regarding if the doc has
nested field or not.
On Thursday, April 16, 2015 at 5:36:04 PM UTC+8, Xudong You wrote:
I was confused by the docs count value displaying in head plugin if there
is nest type field define in mapping
For example, I created a new index with following mapping:
{
"mappings" : {
"doc" : {
"properties" : {
"QueryClicks" : {
"type" : "nested",
"properties" : {
"Count" : {
"type" : "long"
},
"Term" : {
"type" : "string"
}
}
},
"Title" : {
"type" : "string"
}
}
}
}
}
And then insert ONE doc:
{
"QueryClicks":[{"Term":"term1","Count":10},{"Term":"term2","Count":10}],
"Title":"test title"
}
Then refresh Head, the docs shown on Head is 3:
size: 3.57ki (6.97ki)
docs: 3 (3)
Go to the "browser" tab and select the type. That will show the count you
are looking for.
On Thursday, April 16, 2015 at 10:44:29 PM UTC-4, Xudong You wrote:
Just figured out that the doc count is actually the number of document +
the number of items of nested field, in my case, the QueryClicks field has
two items, then the total number of doc shown on head is 1+2=3.
But this might confuse the people who view doc counts on head or other UI
plug-in.
Is there anyway let head just show the doc count, regarding if the doc has
nested field or not.
On Thursday, April 16, 2015 at 5:36:04 PM UTC+8, Xudong You wrote:
I was confused by the docs count value displaying in head plugin if there
is nest type field define in mapping
For example, I created a new index with following mapping:
{
"mappings" : {
"doc" : {
"properties" : {
"QueryClicks" : {
"type" : "nested",
"properties" : {
"Count" : {
"type" : "long"
},
"Term" : {
"type" : "string"
}
}
},
"Title" : {
"type" : "string"
}
}
}
}
}
And then insert ONE doc:
{
"QueryClicks":[{"Term":"term1","Count":10},{"Term":"term2","Count":10}],
"Title":"test title"
}
Then refresh Head, the docs shown on Head is 3:
size: 3.57ki (6.97ki)
docs: 3 (3)
On Friday, April 17, 2015 at 11:14:36 AM UTC+8, Glen Smith wrote:
Go to the "browser" tab and select the type. That will show the count you
are looking for.
On Thursday, April 16, 2015 at 10:44:29 PM UTC-4, Xudong You wrote:
Just figured out that the doc count is actually the number of document +
the number of items of nested field, in my case, the QueryClicks field has
two items, then the total number of doc shown on head is 1+2=3.
But this might confuse the people who view doc counts on head or other UI
plug-in.
Is there anyway let head just show the doc count, regarding if the doc
has nested field or not.
On Thursday, April 16, 2015 at 5:36:04 PM UTC+8, Xudong You wrote:
I was confused by the docs count value displaying in head plugin if
there is nest type field define in mapping
For example, I created a new index with following mapping:
{
"mappings" : {
"doc" : {
"properties" : {
"QueryClicks" : {
"type" : "nested",
"properties" : {
"Count" : {
"type" : "long"
},
"Term" : {
"type" : "string"
}
}
},
"Title" : {
"type" : "string"
}
}
}
}
}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.