{ }
{"query" : {"match" : { "message": "this is a test"}}}
{"query" : {"match_all" : {}}}
Response:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "key [query] is not supported in the metadata section"
}
],
"type": "illegal_argument_exception",
"reason": "key [query] is not supported in the metadata section"
},
"status": 400
}
Actually, i created index properly and updated mappings too. Everything is good but when i try to execute multi search query im facing that exception. I tried with correct example too.. again same exception. Is anything related to security/privileges/user privileges?..im not sure about it. help me the same
Thanks for your response. Its working fine as expected.
But another scenario, Im using Java High level rest client version 7.17.5. Im applying the same but it doesnt work. Please find the below code
SearchSourceBuilder metaDataSearch = new SearchSourceBuilder();
org.elasticsearch.action.search.SearchRequest metaSearch = new org.elasticsearch.action.search.SearchRequest().source(metaDataSearch).indices(indexName);
SearchSourceBuilder keywordExactRequestBuilder = new SearchSourceBuilder().size(10);
keywordExactRequestBuilder.query(QueryBuilders.matchAllQuery());
org.elasticsearch.action.search.SearchRequest keywordExactRequestSearch = new org.elasticsearch.action.search.SearchRequest().source(keywordExactRequestBuilder).indices(indexName);
MultiSearchRequest multiSearchRequest = new MultiSearchRequest()
.add(metaSearch)
.add(keywordExactRequestSearch);
MultiSearchResponse multiSearchResponse = null;
try {
multiSearchResponse = elasticClient.msearch(multiSearchRequest, RequestOptions.DEFAULT);
} catch (IOException e) {
e.printStackTrace();
}
Im facing the below exception
org.jboss.resteasy.spi.UnhandledException: ElasticsearchStatusException[Elasticsearch exception [type=illegal_argument_exception, reason=key [types] is not supported in the metadata section]]
.......
Caused by:
ElasticsearchStatusException[Elasticsearch exception [type=illegal_argument_exception, reason=key [types] is not supported in the metadata section]]
......
Im enabled API compatibility mode. Im using elasticsearch version 8.3.2
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.