SearchParseException if run query with sorting on not yet created type of document

Hello,
I need to run queries periodically. But because my mappings created
dynamically it is possible that I could run query against document type
which is not yet created. And if my query need to sort on some field I'm
getting SearchParseException:

Failed to execute phase [query], all shards failed; shardFailures {[bNA_-
MVqQ-6aBKZ_iki0hQ][ccio][3]: SearchParseException[[ccio][3]: query[
ConstantScore(cache(NotFilter(cache(BooleanFilter(
…… snip …..
Parse Failure [No mapping found for [userId] in order to sort on]

It is a valid message, but should ES throw the error, instead of returning
empty result, as it would return on any other query against not existed
type? I expected empty result of course.

Thanks,
Eugene

--
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/3e29d7fb-f5b3-4405-bc3a-dbd7b7fdaa8d%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.