Is your feature request related to a problem? Please describe.
I want to validate user input before sending a query to Elasticsearch
Describe the solution you'd like
A query parser, or a parameterized query possibility
Additional context
Current my code looks somewhat like this, but I want to escape user input:
// TODO: This is properly a bad way to search users
let value = format!("{}"", part_of_username);
let search = elastic_con
.search(SearchParts::Index(&["users"]))
.body(json!({
"query": {
"match": {
"username": {
"query": value, // <-- value isn't escaped and can contain malicious data
"analyzer": "standard"
}
}
}
}));
Is your feature request related to a problem? Please describe. I want to validate user input before sending a query to Elasticsearch
Describe the solution you'd like A query parser, or a parameterized query possibility
Additional context Current my code looks somewhat like this, but I want to escape user input: