I created an issue for this and wasn't going to bother the discussion
board, but since I found a workaround I thought I'd mention it here
for the benefit of Google-searchers. Shay, if you don't think it needs
to be in both places, feel free to delete in one of them!
In "js" and "mvel", 0.16.2:
1] If you try to treat a single value as an array using
"doc['field'].values", you get an exception (which is annoying because
it includes arrays of size 1, where as a script writer you'd obviously
like to have a single clause to handle all arrays)
2] More importantly, "doc['field'].multiValued" returns true in both
cases, so you cannot distinguish between arrays of size 1 and size >
== Array" instead.