Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
Hi, I’m performing an Open search bulk post request for adding a document id in the search cluster and getting a 400 status code as a response.
Here is the request:
{"index": {"_index": "push", "_id": "id1-HTTP"}}
{"query": {"bool": {"must": [{"bool": {"should": [{"terms": {"channel": [123795, 131359]}}, {"query_string": {"query": "channel:(81929 OR 122641) "}}, {"bool": {"must": [{"range": {"doc_date": {"lte": "now-30d"}}}, {"query_string": {"query": "((channel:(90063) AND copyright_holder_id:(1717 OR 8818)) OR (channel:(90063) AND ((-copyright_holder_id:[* TO *]) OR copyright_holder_id:(2016 OR 2881))) OR (channel:(126215 OR 106339)) OR (channel:(90063) AND copyright_holder_id:(1586 OR 10489)) OR (channel:(90063) AND copyright_holder_id:(11289 OR 9378))) "}}]}}, {"bool": {"must": [{"range": {"doc_date": {"lte": "now-30d"}}}, {"query_string": {"query": "channel:(90063) "}}]}}, {"bool": {"must": [{"range": {"doc_date": {"lte": "now-30d"}}}, {"query_string": {"query": "channel:(130019) "}}]}}, {"bool": {"must": [{"range": {"doc_date": {"lte": "now-30d"}}}, {"query_string": {"query": "channel:(90063) AND ((-copyright_holder_id:[* TO *]) OR copyright_holder_id:(2016 OR 2881)) AND audio_nature:(speech OR voiced OR naturalSound)"}}]}}, {"bool": {"must": [{"range": {"doc_date": {"lte": "now-30d"}}}, {"query_string": {"query": "((channel:(90063) AND copyright_holder_id:(1717 OR 8818)) OR (channel:(90063) AND ((-copyright_holder_id:[* TO *]) OR copyright_holder_id:(2016 OR 2881 ))) OR (channel:(126215 OR 106339)) OR (channel:(90063) AND copyright_holder_id:(1586 OR 10489)) OR (channel:(90063) AND copyright_holder_id:(11289 OR 9378))) "}}]}}, {"query_string": {"query": "channel:(81929 OR 122641)"}}, {"query_string": {"query": "channel:(90063) AND copyright_holder_id:(11289 OR 9378)"}}, {"query_string": {"query": "channel:(90063)"}}, {"bool": {"must": [{"bool": {"should": [{"terms": {"channel": [98304, 98306]}}, {"query_string": {"query": "channel:(823 OR 140757)"}}, {"query_string": {"query": ""}}, {"query_string": {"query": "channel:(135379) AND ((*:* -copyright_holder_id:[* TO *]) OR copyright_holder_id:(2016 OR 2881)) "}}, {"query_string": {"query": "channel:(688 OR 689)"}}, {"query_string": {"query": "channel:(539 OR 540)"}}, {"query_string": {"query": "213123"}}, {"query_string": {"query": "channel:(24217)"}}]}}, {"range": {"doc_date": {"gte": "now-30d/h", "lte": "now/d"}}}]}}]}}], "must_not": [{"terms": {"outcode": ["audMedia:APEC", "audMedia:GAEBK", "audMedia:PIOL", "audMedia:LGFOXTHM", "audMedia:RCQV6"]}}, {"bool": {"must": [{"range": {"doc_date": {"lt": "now-24h/h"}}}, {"term": {"destination": "RPAU"}}]}}, {"bool": {"must": [{"terms": {"channel": [90063, 135379, 249985]}}, {"bool": {"should": [{"bool": {"must_not": [{"terms": {"copyright_holder_id": [1586, 1717]}}]}}, {"bool": {"must": [{"bool": {"must_not": [{"exists": {"field": "copyright_holder_id"}}]}}, {"bool": {"must_not": [{"term": {"media_type": "T"}}]}}]}}]}}]}}]}}, "info": {"user_id": id1, "account_id": acct_id, "protocol": "HTTP", "login_name": "Pus64206893571087", "email": "testuse1@mail.com", "timestamp": "2023-06-23T12:51:31Z"}}
the response:
{
"took": 11,
"errors": true,
"items": [
{
"index": {
"_index": "items_notify",
"_id": "id1-HTTP",
"status": 400,
"error": {
"type": "mapper_parsing_exception",
"reason": "failed to parse",
"caused_by": {
"type": "query_shard_exception",
"reason": "No field mapping can be found for the field with name [*]",
"index": "items_notify",
"index_uuid": "YSMQnBreQsWRkO9EUFcvAQ"
}
}
}
}
]
}
Describe the issue:
When performing bulk requests get 400 error with “No field mapping can be found for the field with name [*]”
I think I’m getting the error because of (-copyright_holder_id:[* TO *])
and (*:* -copyright_holder_id:[* TO *])
and I tried alternate ways to do it but no luck and I’m newbie for OpenSearch and this query is coming from the system and I checked all the fields in the query are mapped in the index mapping as well.
Configuration:
Relevant Logs or Screenshots: