-
Notifications
You must be signed in to change notification settings - Fork 523
aws_bedrock: fix handling of strings with braces in content fields #16681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
aws_bedrock: fix handling of strings with braces in content fields #16681
Conversation
…ntent.content fields
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
🚀 Benchmarks reportTo see the full report comment with |
💚 Build Succeeded
|
chrisberkhout
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I do this on 9.2.0 it works fine:
PUT myexampleindex
{
"mappings": {
"properties": {
"myfield": { "type": "keyword" }
}
}
}
POST myexampleindex/_doc
{
"myfield": """{"k": "v"}"""
}
GET myexampleindex/_search
{
"query": {
"match_all": {}
}
}
Maybe this is an issue that has since been resolved in ES?
I tried with both an explicitly defined keyword field and with dynamic mapping. Both were fine with a string that is or looks like JSON being indexed as keyword.
|
@chrisberkhout I have tried in version 8.18.4 which is the one where the error originally happened and the example case in Dev Tools work as well. It also works with a string starting with a brace, and with the same string that originally caused the index error. So I decided to apply this fix based on the error message as I think something should be missing with the field format related to the error. |
|
Thinking about this some more... I think the incoming document must have had an object where a JSON string was expected. Here's an example of that: It produces this error: This might have something to do with having array values for messages and for content, which those two processors before the change in the pipeline don't seem to handle. |
chrisberkhout
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed this more offline. I think this doesn't reproduce or fix the error we're interested in. Probably best to close this and address the issue in a new PR.
Proposed commit message
Checklist
changelog.ymlfile.