Would creating a "real" query language instead of a serialized object representation make sense then?
This would allow for a conciser syntax, making it easier to write (that's why I asked who would be writing such queries), but probably it'd be more work to create such a language. I guess a sub-set of JPQL would work for some parts, but additional elements would be needed for facets etc.
For other applications (at least Java ones) which are creating queries programmatically it could also be an option to extend the DSL to allow for specifying the output format:
String query = buildQueryBuilder()
.forEntity( Hypothesis.class )
.get()
.all()
.createQuery( Format.JSON );
//submit query...
The DSL implementation would create an actual Lucene query, a JSON string etc., depending on the given format.
Not sure what makes sense, just throwing out some ideas.
--Gunnar