add an option to provide the array of ranges "on" the field name itself
This commit is contained in:
parent
99af6df0ea
commit
7719dcd790
|
@ -56,6 +56,10 @@ public class RangeFacetCollectorParser implements FacetCollectorParser {
|
|||
if (token == XContentParser.Token.FIELD_NAME) {
|
||||
fieldName = parser.currentName();
|
||||
} else if (token == XContentParser.Token.START_ARRAY) {
|
||||
if (!"ranges".equals(fieldName)) {
|
||||
// this is the actual field name, so also update the keyField
|
||||
keyField = fieldName;
|
||||
}
|
||||
while ((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) {
|
||||
RangeFacet.Entry entry = new RangeFacet.Entry();
|
||||
while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
|
||||
|
@ -77,10 +81,6 @@ public class RangeFacetCollectorParser implements FacetCollectorParser {
|
|||
}
|
||||
entries.add(entry);
|
||||
}
|
||||
if (!"ranges".equals(fieldName)) {
|
||||
// this is the actual field name, so also update the keyField
|
||||
keyField = fieldName;
|
||||
}
|
||||
} else if (token == XContentParser.Token.START_OBJECT) {
|
||||
if ("params".equals(fieldName)) {
|
||||
params = parser.map();
|
||||
|
|
Loading…
Reference in New Issue