Java API - Having problem by searching data on kibana

SearchRequest request = new SearchRequest();
request.indices("search_products");
request.source(new SearchSourceBuilder().query(QueryBuilders.wrapperQuery(queryString)));
SearchResponse response = client.search(request, RequestOptions.DEFAULT);

I am using this java code to get search results from kibana. but i am getting below error:

{"error":{"root_cause":[{"type":"parsing_exception","reason":"unknown query [query]","line":2,"col":12}],"type":"parsing_exception","reason":"unknown query [query]","line":2,"col":12,"caused_by":{"type":"named_object_not_found_exception","reason":"[2:12] unknown field [query]"}},"status":400}

Welcome to our community! :smiley:

I don't know java, but why are you querying Kibana here, and not Elasticsearch?