Error log: You’ll see this error when trying to create an index, define a mapping, or run a query with an invalid or misspelled parameter.
When creating an index:
JSON
None
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "unknown key [propertis] for create index" // <-- Typo!
}
],
"type": "illegal_argument_exception",
"reason": "unknown key [propertis] for create index"
},
"status": 400
}
When running a query:
JSON
None
"root_cause": [
{
"type": "parsing_exception",
"reason": "unknown parameter [fromm]
did you mean [from]?", // <-- Helpful suggestion!
"line": 1, "col": 20
}
]
Why… is this happening? This is a straightforward typo or syntax error. The JSON key or parameter you’ve used in your API request is not recognized by OpenSearch for that specific context.
- In the first example, the user wrote
"propertis"inside their_mappingsblock, but the correct key is"properties". - In the second example, the user wrote
"fromm": 10in their search query, but the correct parameter is"from": 10.
OpenSearch’s parser is strict. If it doesn’t recognize a key, it rejects the entire request to prevent unexpected behavior. The good news is that the error message is usually very specific and often even suggests the correct spelling.
Best Practice:
- Read the error message: This is the easiest error to fix. The error message tells you the exact key it doesn’t understand.
- Check the “did you mean…” suggestion: OpenSearch is often smart enough to guess what you meant. If it provides a suggestion, it’s almost certainly correct.
- Use OpenSearch dashboards dev tools: The Dev Tools console has excellent auto-complete. As you start typing
"prop...", it will suggest"properties", helping you avoid these typos in the first place. - Consult the documentation: When in doubt, check the official OpenSearch documentation for the specific API you’re using (e.g., the
_searchAPI or_mappingsAPI) to see the full list of valid parameters and keys.
What else can I do? We’ve all been there—staring at a JSON object and unable to see the typo. If you’re stuck, paste your JSON and the error into the OpenSearch community forums. A fresh set of eyes will usually spot the mistake in seconds. For direct support, contact us in The OpenSearch Slack Channel in #General.