Elasticsearch: is it possible to provide a raw json dsl query to HighLevelRestClient ?

Created on 22 Jan 2018  路  2Comments  路  Source: elastic/elasticsearch

is it possible to provide a raw json dsl query to HighLevelRestClient ?
to be clear, by query here I mean the whole shebang, size, query, aggregations, etc.

I've tried

                SearchRequest searchRequest = new SearchRequest(); 
        SearchSourceBuilder sourceBuilder = new SearchSourceBuilder(); 
        searchRequest.indices(...);
        sourceBuilder.query(QueryBuilders.wrapperQuery(myJson));
        searchRequest.source(sourceBuilder);

but it only ever ends in failure.
I can get it to work via the low level api, but not the high level api.

the low level api is a pita to work with. building query path strings etc and the responses all have to be hand parsed into something useful, where the old java transport client api, and the highlevelrestclient are quite capable of massaging the result in to a useful SearchResult object.

am I doing something wrong, or is this just life now?

All 2 comments

Please ask this question on discuss.elastic.co where we can give a better support.
This space is only for confirmed issues or feature requests which have been discussed on discuss.elastic.co.

Thanks!

consider this a feature request if the high level client really doesn't support this.
discuss on elastic.co sux, and so do most of the answers on it. far better off here or stackoverflow.

Was this page helpful?
0 / 5 - 0 ratings