New API looks like this:
{"query":{"terms":["watered","down"],"field":"desc"}}
instead of
{"query":{"terms":[{"term":"watered","field":"desc"},{"term":"down","field":"desc"}]}}
So that it eliminats accidental errors by supplying terms with different
fields, or different type of query
This is convenient to see either complicated queries build
programmatically, or to make sure the query parser does what it is
expected to do.
Note only queries made of bleve basic queries are supported. If we
wanted to support external queries, for instance string queries with an
alternative parser, I suggest to introduce some kind of:
type ExpandableQuery interface {
Query
Expand(*IndexMapping) (Query, error)
}
and type assert to that instead of *queryStringQuery.