we should do it at the very first oportunity we have. if we could do it when adding the document to the query builder, i would prefer that as then you would see from the exception where you did a mistake, rather than get the exception later when actually building the query. but in terms of generating the query, this would be the first possible place i think.