Is there a way to build a query in elastic4s
from a JSON string?
For example, something like:
client.execute { "{ \"query\": ..., \"aggs\": ..., ... }" }
Is there a way to build a query in elastic4s
from a JSON string?
For example, something like:
client.execute { "{ \"query\": ..., \"aggs\": ..., ... }" }
It doesn't support a truly raw query in the sense of passing a string to client.execute
. This is because the execute method wraps the Java client, and the Java client provides seperate methods per request type.
But you can pass in a raw query string, so something like:
search in "*" types("users", "tweets") limit 5 rawQuery {
+ """{ "prefix": { "bands": { "prefix": "coldplay", "boost": 5.0, "rewrite": "yes" } } }"""