Facet count - strange behaviour - different result for different size of most frequent terms

I'm looking for any good explanation for a different value for facet count.
I have changed only the return size of the most frequent terms.

My ES is in version 0.20.5.

The query looks like this:

{
"size": 0,
"query": {
"field": {
"_all": "*"
}
},
"facets": {
"publisher1": {
"terms": {
"field": "publisher.untouched",
"size": 1
}
},
"publisher2": {
"terms": {
"field": "publisher.untouched",
"size": 2
}
},
"publisher3": {
"terms": {
"field": "publisher.untouched",
"size": 3
}
},
"publisher4": {
"terms": {
"field": "publisher.untouched",
"size": 4
}
},
"publisher10": {
"terms": {
"field": "publisher.untouched",
"size": 10
}
}
}
}

And the answer is:
{
"took" : 6,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 319,
"max_score" : 1.0,
"hits" : [ ]
},
"facets" : {
"publisher1" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 13,
"terms" : [ {
"term" : "ABC",
"count" : 17
} ]
},
"publisher2" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 11,
"terms" : [ {
"term" : "ABC",
"count" : 17
}, {
"term" : "publisher",
"count" : 2
} ]
},
"publisher3" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 8,
"terms" : [ {
"term" : "ABC",
"count" : 18
}, {
"term" : "publisher",
"count" : 2
}, {
"term" : "DEF",
"count" : 2
} ]
},
"publisher4" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 6,
"terms" : [ {
"term" : "ABC",
"count" : 18
}, {
"term" : "publisher",
"count" : 2
}, {
"term" : "DEF",
"count" : 2
}, {
"term" : "ABC1",
"count" : 2
} ]
},
"publisher10" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 0,
"terms" : [ {
"term" : "ABC",
"count" : 18
}, {
"term" : "publisher",
"count" : 2
}, {
"term" : "DEF",
"count" : 2
}, {
"term" : "ABC1",
"count" : 2
}, {
"term" : "test1",
"count" : 1
}, {
"term" : "self",
"count" : 1
}, {
"term" : "eva3",
"count" : 1
}, {
"term" : "claire",
"count" : 1
}, {
"term" : "ABC2",
"count" : 1
}, {
"term" : "asdfa",
"count" : 1
} ]
}
}
}

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

You have probably more than one shard, don't you?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 7 mars 2013 à 20:16, Artur Konczak akonczak@gmail.com a écrit :

I'm looking for any good explanation for a different value for facet count.
I have changed only the return size of the most frequent terms.

My ES is in version 0.20.5.

The query looks like this:

{
"size": 0,
"query": {
"field": {
"_all": "*"
}
},
"facets": {
"publisher1": {
"terms": {
"field": "publisher.untouched",
"size": 1
}
},
"publisher2": {
"terms": {
"field": "publisher.untouched",
"size": 2
}
},
"publisher3": {
"terms": {
"field": "publisher.untouched",
"size": 3
}
},
"publisher4": {
"terms": {
"field": "publisher.untouched",
"size": 4
}
},
"publisher10": {
"terms": {
"field": "publisher.untouched",
"size": 10
}
}
}
}

And the answer is:
{
"took" : 6,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 319,
"max_score" : 1.0,
"hits" :
},
"facets" : {
"publisher1" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 13,
"terms" : [ {
"term" : "ABC",
"count" : 17
} ]
},
"publisher2" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 11,
"terms" : [ {
"term" : "ABC",
"count" : 17
}, {
"term" : "publisher",
"count" : 2
} ]
},
"publisher3" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 8,
"terms" : [ {
"term" : "ABC",
"count" : 18
}, {
"term" : "publisher",
"count" : 2
}, {
"term" : "DEF",
"count" : 2
} ]
},
"publisher4" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 6,
"terms" : [ {
"term" : "ABC",
"count" : 18
}, {
"term" : "publisher",
"count" : 2
}, {
"term" : "DEF",
"count" : 2
}, {
"term" : "ABC1",
"count" : 2
} ]
},
"publisher10" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 0,
"terms" : [ {
"term" : "ABC",
"count" : 18
}, {
"term" : "publisher",
"count" : 2
}, {
"term" : "DEF",
"count" : 2
}, {
"term" : "ABC1",
"count" : 2
}, {
"term" : "test1",
"count" : 1
}, {
"term" : "self",
"count" : 1
}, {
"term" : "eva3",
"count" : 1
}, {
"term" : "claire",
"count" : 1
}, {
"term" : "ABC2",
"count" : 1
}, {
"term" : "asdfa",
"count" : 1
} ]
}
}
}

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

David,

Could you elaborate how having multiple shard can affect facet counts?

Thank you,
Alex

On Thursday, March 7, 2013 2:33:04 PM UTC-5, David Pilato wrote:

You have probably more than one shard, don't you?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 7 mars 2013 à 20:16, Artur Konczak <akon...@gmail.com <javascript:>> a
écrit :

I'm looking for any good explanation for a different value for facet
count.
I have changed only the return size of the most frequent terms.

My ES is in version 0.20.5.

The query looks like this:

{
"size": 0,
"query": {
"field": {
"_all": "*"
}
},
"facets": {
"publisher1": {
"terms": {
"field": "publisher.untouched",
"size": 1
}
},
"publisher2": {
"terms": {
"field": "publisher.untouched",
"size": 2
}
},
"publisher3": {
"terms": {
"field": "publisher.untouched",
"size": 3
}
},
"publisher4": {
"terms": {
"field": "publisher.untouched",
"size": 4
}
},
"publisher10": {
"terms": {
"field": "publisher.untouched",
"size": 10
}
}
}
}

And the answer is:
{
"took" : 6,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 319,
"max_score" : 1.0,
"hits" :
},
"facets" : {
"publisher1" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 13,
"terms" : [ {
"term" : "ABC",
"count" : 17
} ]
},
"publisher2" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 11,
"terms" : [ {
"term" : "ABC",
"count" : 17
}, {
"term" : "publisher",
"count" : 2
} ]
},
"publisher3" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 8,
"terms" : [ {
"term" : "ABC",
"count" : 18
}, {
"term" : "publisher",
"count" : 2
}, {
"term" : "DEF",
"count" : 2
} ]
},
"publisher4" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 6,
"terms" : [ {
"term" : "ABC",
"count" : 18
}, {
"term" : "publisher",
"count" : 2
}, {
"term" : "DEF",
"count" : 2
}, {
"term" : "ABC1",
"count" : 2
} ]
},
"publisher10" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 0,
"terms" : [ {
"term" : "ABC",
"count" : 18
}, {
"term" : "publisher",
"count" : 2
}, {
"term" : "DEF",
"count" : 2
}, {
"term" : "ABC1",
"count" : 2
}, {
"term" : "test1",
"count" : 1
}, {
"term" : "self",
"count" : 1
}, {
"term" : "eva3",
"count" : 1
}, {
"term" : "claire",
"count" : 1
}, {
"term" : "ABC2",
"count" : 1
}, {
"term" : "asdfa",
"count" : 1
} ]
}
}
}

--
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:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

So you have more than one shard :wink:

Facets are computed per shard. Then results are merged.
If you are unlucky, a value that is in the TOP5 in shard 1 is only on position #6 in shard 2.
So when you ask for a TOP5 facet, these ones won't be merged.

See also: Inconsistent facet counts · Issue #1832 · elastic/elasticsearch · GitHub
And https://github.com/elasticsearch/elasticsearch/issues/1305

HTH

David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 7 mars 2013 à 23:48, AlexR roytmana@gmail.com a écrit :

David,

Could you elaborate how having multiple shard can affect facet counts?

Thank you,
Alex

On Thursday, March 7, 2013 2:33:04 PM UTC-5, David Pilato wrote:

You have probably more than one shard, don't you?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 7 mars 2013 à 20:16, Artur Konczak akon...@gmail.com a écrit :

I'm looking for any good explanation for a different value for facet count.
I have changed only the return size of the most frequent terms.

My ES is in version 0.20.5.

The query looks like this:

{
"size": 0,
"query": {
"field": {
"_all": "*"
}
},
"facets": {
"publisher1": {
"terms": {
"field": "publisher.untouched",
"size": 1
}
},
"publisher2": {
"terms": {
"field": "publisher.untouched",
"size": 2
}
},
"publisher3": {
"terms": {
"field": "publisher.untouched",
"size": 3
}
},
"publisher4": {
"terms": {
"field": "publisher.untouched",
"size": 4
}
},
"publisher10": {
"terms": {
"field": "publisher.untouched",
"size": 10
}
}
}
}

And the answer is:
{
"took" : 6,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 319,
"max_score" : 1.0,
"hits" :
},
"facets" : {
"publisher1" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 13,
"terms" : [ {
"term" : "ABC",
"count" : 17
} ]
},
"publisher2" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 11,
"terms" : [ {
"term" : "ABC",
"count" : 17
}, {
"term" : "publisher",
"count" : 2
} ]
},
"publisher3" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 8,
"terms" : [ {
"term" : "ABC",
"count" : 18
}, {
"term" : "publisher",
"count" : 2
}, {
"term" : "DEF",
"count" : 2
} ]
},
"publisher4" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 6,
"terms" : [ {
"term" : "ABC",
"count" : 18
}, {
"term" : "publisher",
"count" : 2
}, {
"term" : "DEF",
"count" : 2
}, {
"term" : "ABC1",
"count" : 2
} ]
},
"publisher10" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 0,
"terms" : [ {
"term" : "ABC",
"count" : 18
}, {
"term" : "publisher",
"count" : 2
}, {
"term" : "DEF",
"count" : 2
}, {
"term" : "ABC1",
"count" : 2
}, {
"term" : "test1",
"count" : 1
}, {
"term" : "self",
"count" : 1
}, {
"term" : "eva3",
"count" : 1
}, {
"term" : "claire",
"count" : 1
}, {
"term" : "ABC2",
"count" : 1
}, {
"term" : "asdfa",
"count" : 1
} ]
}
}
}

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Darn darn darn!!

Thanks for the pointer David. Do you ever sleep? You seem to have been answering question for straight 24 hours :slight_smile:

I should have known better and evaluated/developed with multiple shards then I would have known of it. But I had just 70k docs so I did not want to skew my searches.

The app is heavily dependent on counts and summs and everything gets rolled up so any deviation will be very visible

Need to check how it affects other and missing counts if at all

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Haha! Sometimes I wake up during the night (insomnia ?) and I look at the ML and... :wink:

There are some way to get right numbers:

  • index with 1 shard
  • use routing and when doing search use this routing option. But it means that you can group documents by something. For example, if in your use case, you have a username and the user can only search on its docs, use routing=username. Documents will go to the same shard. So facets will have all needed documents.
  • increase the number of buckets. If you need a TOP5, ask for a TOP20 for example. You will have more chance to have the good answer.

That said, I would love to have an option that allows to do another round trip on shards that did not gives any values for the current TOPx merged values to have a chance to correct numbers.
There is a cost, but if the user really need absolute values (not a percentage), I think he will accept to pay the price. -> this is the suggestion in the issues BTW.

HTH
(Time for a real wake up and coffee :wink: )

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 8 mars 2013 à 04:59, AlexR roytmana@gmail.com a écrit :

Darn darn darn!!

Thanks for the pointer David. Do you ever sleep? You seem to have been answering question for straight 24 hours :slight_smile:

I should have known better and evaluated/developed with multiple shards then I would have known of it. But I had just 70k docs so I did not want to skew my searches.

The app is heavily dependent on counts and summs and everything gets rolled up so any deviation will be very visible

Need to check how it affects other and missing counts if at all

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Yes, I have 5 shards, I should look harder for an answer on the group
before I post new query.
The best explanation for my problem is here:

Thank you David.

On Thursday, 7 March 2013 19:33:04 UTC, David Pilato wrote:

You have probably more than one shard, don't you?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 7 mars 2013 à 20:16, Artur Konczak <akon...@gmail.com <javascript:>> a
écrit :

I'm looking for any good explanation for a different value for facet
count.
I have changed only the return size of the most frequent terms.

My ES is in version 0.20.5.

The query looks like this:

{
"size": 0,
"query": {
"field": {
"_all": "*"
}
},
"facets": {
"publisher1": {
"terms": {
"field": "publisher.untouched",
"size": 1
}
},
"publisher2": {
"terms": {
"field": "publisher.untouched",
"size": 2
}
},
"publisher3": {
"terms": {
"field": "publisher.untouched",
"size": 3
}
},
"publisher4": {
"terms": {
"field": "publisher.untouched",
"size": 4
}
},
"publisher10": {
"terms": {
"field": "publisher.untouched",
"size": 10
}
}
}
}

And the answer is:
{
"took" : 6,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 319,
"max_score" : 1.0,
"hits" :
},
"facets" : {
"publisher1" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 13,
"terms" : [ {
"term" : "ABC",
"count" : 17
} ]
},
"publisher2" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 11,
"terms" : [ {
"term" : "ABC",
"count" : 17
}, {
"term" : "publisher",
"count" : 2
} ]
},
"publisher3" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 8,
"terms" : [ {
"term" : "ABC",
"count" : 18
}, {
"term" : "publisher",
"count" : 2
}, {
"term" : "DEF",
"count" : 2
} ]
},
"publisher4" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 6,
"terms" : [ {
"term" : "ABC",
"count" : 18
}, {
"term" : "publisher",
"count" : 2
}, {
"term" : "DEF",
"count" : 2
}, {
"term" : "ABC1",
"count" : 2
} ]
},
"publisher10" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 0,
"terms" : [ {
"term" : "ABC",
"count" : 18
}, {
"term" : "publisher",
"count" : 2
}, {
"term" : "DEF",
"count" : 2
}, {
"term" : "ABC1",
"count" : 2
}, {
"term" : "test1",
"count" : 1
}, {
"term" : "self",
"count" : 1
}, {
"term" : "eva3",
"count" : 1
}, {
"term" : "claire",
"count" : 1
}, {
"term" : "ABC2",
"count" : 1
}, {
"term" : "asdfa",
"count" : 1
} ]
}
}
}

--
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:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

No problem.

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 8 mars 2013 à 09:54, Artur Konczak akonczak@gmail.com a écrit :

Yes, I have 5 shards, I should look harder for an answer on the group before I post new query.
The best explanation for my problem is here:
https://github.com/elasticsearch/elasticsearch/issues/1305

Thank you David.

On Thursday, 7 March 2013 19:33:04 UTC, David Pilato wrote:
You have probably more than one shard, don't you?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 7 mars 2013 à 20:16, Artur Konczak akon...@gmail.com a écrit :

I'm looking for any good explanation for a different value for facet count.
I have changed only the return size of the most frequent terms.

My ES is in version 0.20.5.

The query looks like this:

{
"size": 0,
"query": {
"field": {
"_all": "*"
}
},
"facets": {
"publisher1": {
"terms": {
"field": "publisher.untouched",
"size": 1
}
},
"publisher2": {
"terms": {
"field": "publisher.untouched",
"size": 2
}
},
"publisher3": {
"terms": {
"field": "publisher.untouched",
"size": 3
}
},
"publisher4": {
"terms": {
"field": "publisher.untouched",
"size": 4
}
},
"publisher10": {
"terms": {
"field": "publisher.untouched",
"size": 10
}
}
}
}

And the answer is:
{
"took" : 6,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 319,
"max_score" : 1.0,
"hits" :
},
"facets" : {
"publisher1" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 13,
"terms" : [ {
"term" : "ABC",
"count" : 17
} ]
},
"publisher2" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 11,
"terms" : [ {
"term" : "ABC",
"count" : 17
}, {
"term" : "publisher",
"count" : 2
} ]
},
"publisher3" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 8,
"terms" : [ {
"term" : "ABC",
"count" : 18
}, {
"term" : "publisher",
"count" : 2
}, {
"term" : "DEF",
"count" : 2
} ]
},
"publisher4" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 6,
"terms" : [ {
"term" : "ABC",
"count" : 18
}, {
"term" : "publisher",
"count" : 2
}, {
"term" : "DEF",
"count" : 2
}, {
"term" : "ABC1",
"count" : 2
} ]
},
"publisher10" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 0,
"terms" : [ {
"term" : "ABC",
"count" : 18
}, {
"term" : "publisher",
"count" : 2
}, {
"term" : "DEF",
"count" : 2
}, {
"term" : "ABC1",
"count" : 2
}, {
"term" : "test1",
"count" : 1
}, {
"term" : "self",
"count" : 1
}, {
"term" : "eva3",
"count" : 1
}, {
"term" : "claire",
"count" : 1
}, {
"term" : "ABC2",
"count" : 1
}, {
"term" : "asdfa",
"count" : 1
} ]
}
}
}

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Thanks David :slight_smile:

On Friday, 8 March 2013 08:54:13 UTC, Artur Konczak wrote:

Yes, I have 5 shards, I should look harder for an answer on the group
before I post new query.
The best explanation for my problem is here:
https://github.com/elasticsearch/elasticsearch/issues/1305

Thank you David.

On Thursday, 7 March 2013 19:33:04 UTC, David Pilato wrote:

You have probably more than one shard, don't you?

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 7 mars 2013 à 20:16, Artur Konczak akon...@gmail.com a écrit :

I'm looking for any good explanation for a different value for facet
count.
I have changed only the return size of the most frequent terms.

My ES is in version 0.20.5.

The query looks like this:

{
"size": 0,
"query": {
"field": {
"_all": "*"
}
},
"facets": {
"publisher1": {
"terms": {
"field": "publisher.untouched",
"size": 1
}
},
"publisher2": {
"terms": {
"field": "publisher.untouched",
"size": 2
}
},
"publisher3": {
"terms": {
"field": "publisher.untouched",
"size": 3
}
},
"publisher4": {
"terms": {
"field": "publisher.untouched",
"size": 4
}
},
"publisher10": {
"terms": {
"field": "publisher.untouched",
"size": 10
}
}
}
}

And the answer is:
{
"took" : 6,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 319,
"max_score" : 1.0,
"hits" :
},
"facets" : {
"publisher1" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 13,
"terms" : [ {
"term" : "ABC",
"count" : 17
} ]
},
"publisher2" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 11,
"terms" : [ {
"term" : "ABC",
"count" : 17
}, {
"term" : "publisher",
"count" : 2
} ]
},
"publisher3" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 8,
"terms" : [ {
"term" : "ABC",
"count" : 18
}, {
"term" : "publisher",
"count" : 2
}, {
"term" : "DEF",
"count" : 2
} ]
},
"publisher4" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 6,
"terms" : [ {
"term" : "ABC",
"count" : 18
}, {
"term" : "publisher",
"count" : 2
}, {
"term" : "DEF",
"count" : 2
}, {
"term" : "ABC1",
"count" : 2
} ]
},
"publisher10" : {
"_type" : "terms",
"missing" : 289,
"total" : 30,
"other" : 0,
"terms" : [ {
"term" : "ABC",
"count" : 18
}, {
"term" : "publisher",
"count" : 2
}, {
"term" : "DEF",
"count" : 2
}, {
"term" : "ABC1",
"count" : 2
}, {
"term" : "test1",
"count" : 1
}, {
"term" : "self",
"count" : 1
}, {
"term" : "eva3",
"count" : 1
}, {
"term" : "claire",
"count" : 1
}, {
"term" : "ABC2",
"count" : 1
}, {
"term" : "asdfa",
"count" : 1
} ]
}
}
}

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.