Facets not showing complete list

I have a search instance that has a complete set of data, which I have
tested by specifically searching for some terms that are missing from my
facets list, and they return results, so I know they have been indexed, yet
they don't show up in the facets.

To test I have been running the following query:

{
"explain": true,
"sort": [{
"ordering_field": "desc"
}, "_score"],
"size": 15,
"from": 0,
"query": {
"match_all" : { }
},
"facets": {
"mood": {
"terms": {
"field": "recipes.moods"
}
}
}
}

The facets part of the result is as follows:

"facets": {
"mood": {
"_type": "terms",
"missing": 3312,
"total": 11116,
"other": 133,
"terms": [{
"term": "Comfort",
"count": 2904
}, {
"term": "Sweet toothed",
"count": 1683
}, {
"term": "Nibbly",
"count": 1332
}, {
"term": "Fun",
"count": 1286
}, {
"term": "Sociable",
"count": 1271
}, {
"term": "Indulgent",
"count": 1104
}, {
"term": "Impatient",
"count": 623
}, {
"term": "Asian-inspired",
"count": 327
}, {
"term": "Italian-inspired",
"count": 268
}, {
"term": "Romantic",
"count": 185
}]
}
}

The problem here is that there should be results for: "Mexican-inspired"
(56 docs), "French-inspired" (46 docs) and "Middle-eastern-inspired" (31
docs). These have documents in the index, so I am completely at a loss as
to why they aren't being returned by this simple facets request. Now I can
see that adding these up to a single number matches the "other" count in
that list. How can I get them to display properly?

Anyone come across this before?

Thanks in advance,
John.

--
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/0818b940-74d2-4933-9104-d640172b7635%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

You can either increase the size of terms returned (default 10) or ask for
all of them to be returned:

{
"facets": {
"mood": {
"terms": {
"size": 50,
"field": "recipes.moods"
}
}
}
}

Or

{
"facets": {
"mood": {
"terms": {
"field": "recipes.moods",
"all_terms": true
}
}
}
}

--
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/05cb0d28-b370-4069-b760-b6087ea3b01c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

RTFM it seems. I didn't know it was defaulted to limit to 10 results.

On Wednesday, March 5, 2014 4:49:13 PM UTC, jo...@embarknow.co.uk wrote:

I have a search instance that has a complete set of data, which I have
tested by specifically searching for some terms that are missing from my
facets list, and they return results, so I know they have been indexed, yet
they don't show up in the facets.

To test I have been running the following query:

{
"explain": true,
"sort": [{
"ordering_field": "desc"
}, "_score"],
"size": 15,
"from": 0,
"query": {
"match_all" : { }
},
"facets": {
"mood": {
"terms": {
"field": "recipes.moods"
}
}
}
}

The facets part of the result is as follows:

"facets": {
"mood": {
"_type": "terms",
"missing": 3312,
"total": 11116,
"other": 133,
"terms": [{
"term": "Comfort",
"count": 2904
}, {
"term": "Sweet toothed",
"count": 1683
}, {
"term": "Nibbly",
"count": 1332
}, {
"term": "Fun",
"count": 1286
}, {
"term": "Sociable",
"count": 1271
}, {
"term": "Indulgent",
"count": 1104
}, {
"term": "Impatient",
"count": 623
}, {
"term": "Asian-inspired",
"count": 327
}, {
"term": "Italian-inspired",
"count": 268
}, {
"term": "Romantic",
"count": 185
}]
}
}

The problem here is that there should be results for: "Mexican-inspired"
(56 docs), "French-inspired" (46 docs) and "Middle-eastern-inspired" (31
docs). These have documents in the index, so I am completely at a loss as
to why they aren't being returned by this simple facets request. Now I can
see that adding these up to a single number matches the "other" count in
that list. How can I get them to display properly?

Anyone come across this before?

Thanks in advance,
John.

--
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/45b42de1-dd1c-4caf-bb26-f488d382466a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

I was just writing my response as you posted. Thanks for the response, I
will learn to read the manual :wink:

On Wednesday, March 5, 2014 4:55:19 PM UTC, Binh Ly wrote:

You can either increase the size of terms returned (default 10) or ask for
all of them to be returned:

{
"facets": {
"mood": {
"terms": {
"size": 50,
"field": "recipes.moods"
}
}
}
}

Or

{
"facets": {
"mood": {
"terms": {
"field": "recipes.moods",
"all_terms": true
}
}
}
}

--
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/689b3125-632b-4136-9993-19538801206e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.