private Item buildIn(String key, Inspector value) {
        HashMap<Integer, Inspector> children = childMap(value);
        String field = children.get(0).asString();
        children.remove(0);

        Preconditions.checkArgument(indexFactsSession.isIndex(field), "Field '%s' does not exist.", field);
        field = indexFactsSession.getCanonicName(field);
        var index = indexFactsSession.getIndex(field);

        if (!index.isInteger() && !index.isString()) {
            throw new IllegalArgumentException("The in operator is only supported for integer and string fields. The field '" +
                    field + "' is not of these types");
        }
        if (index.isInteger() && index.isString()) {
            throw new IllegalArgumentException("The in operator is not supported for fieldsets with a mix of integer and string fields. The fieldset '" +
                    field + "' has both");
        }

        Item item = null;
        if (index.isString()) {
           StringInItem stringInItem = new StringInItem(field);

            for (Inspector child:  children.values()){
                if (child.type() != STRING) {
                    throw new IllegalArgumentException("The field '" + field + "' is a string field, but the argument "
                            + child + " is of type " + child.type());
                }

                stringInItem.addToken(child.asString());
            }
            item = stringInItem;

        } else { // Integer index
            NumericInItem numericInItem = new NumericInItem(field);

            for (Inspector child:  children.values()){
                if (child.type() != LONG) {
                    throw new IllegalArgumentException("The field '" + field + "' is an integer field, but the argument "
                    + child + " is of type " + child.type());
                }
                numericInItem.addToken(child.asLong());
            }

            item = numericInItem;
        }

        return item;
    }
Translates a list of grouping requests on JSON form to a list in the grouping language form
container-search/src/main/java/com/yahoo/search/query/SelectParser.java