I have some string s that I want to match with at least one of two fields, as a substring (s). So for example, if I have the string 456, I would want to search for any entries where in at least one of two specified fields, there exists the string 456. So if field1 had 1234567, it would match, or if field2 had 34567, it would match. Below is an one of the ways I've tried to do it so far, but no luck.
query: {
bool: {
should: { wildcard: { field1: "*" + input + "*"}},
should: { wildcard: { field1: "*" + input + "*"}}
}
}
I have also tried
query: {
query_string: "*" + input + "*",
fields: ["field1", "field2"]
}