-
Notifications
You must be signed in to change notification settings - Fork 94
[BUG] Search API for rules does not support returning specific fields #331
Copy link
Copy link
Closed
Labels
Description
What is the bug?
Search API for rules does not support returning specific fields when the _source field is specified as part of the request body.
How can one reproduce the bug?
Steps to reproduce the behavior:
- Make following search REST API call
POST /_plugins/_security_analytics/rules/_search
{
"query": {
"nested": {
"path": "rule",
"query": {
"term": {
"rule.category": {
"value": "network"
}
}
}
}
},
"_source": ["rule.title"]
}
It should only return the title field
{
...
"hits": [
{
"_index": ".opensearch-sap-pre-packaged-rules-config",
"_id": "503fe26e-b5f2-4944-a126-eab405cc06e5",
"_score": 3.9827108,
"_source": {
"title": "Kerberos Network Traffic RC4 Ticket Encryption"
}
},
...
]
}
}
but it returns all the fields as part of source
What is the expected behavior?
Only specified fields should be returned
What is your host/environment?
Opensearch 2.5
Do you have any screenshots?
NA
Do you have any additional context?
The underlying index does support this, so if the call is made against .opensearch-sap-pre-packaged-rules-config index, it works correctly
Reactions are currently unavailable