For the error that is because query only takes a single input string.
It can have multiple values like "query" : "869336 45345345" however with the values separated by spaces. How this works, you can probably go through this link.
Now looking into your scenario, assuming you'd want to apply phrase match queries for both the values i.e. 869336 and 45345345, you just need to separate out the values in its individual multi-match queries.
POST <your_index_name>/_search
{
"query": {
"bool": {
"must": {
"bool": {
"must": [
{
"multi_match": {
"query": "869336",
"type": "phrase_prefix",
"fields": [
"accountNo",
"moblileNo"
]
}
},
{
"multi_match": {
"query": "45345345",
"type": "phrase_prefix",
"fields": [
"accountNo",
"moblileNo"
]
}
}
],
"should": [],
"must_not": []
}
},
"filter": {
"bool": {
"must": {
"bool": {
"must": [],
"should": [],
"must_not": []
}
}
}
}
}
}
}
Now if you do not want to apply phrase_prefix and instead want to return all the documents having both values in any of the fields, you can simply write the query as below:
POST my-multimatch-index/_search
{
"query": {
"bool": {
"must": {
"bool": {
"must": [
{
"multi_match": {
"query": "869336 45345345",
"fields": [
"accountNo",
"moblileNo"
],
"type": "cross_fields", <--- Note this
"operator": "and" <--- This would mean only return those documents having both these value.
}
}
],
"should": [],
"must_not": []
}
},
"filter": {
"bool": {
"must": {
"bool": {
"must": [],
"should": [],
"must_not": []
}
}
}
}
}
}
}
Note the above comments and how I made use of cross-fields. Best to go through the links to get better understanding.
Anyways feel free to ask for questions and I hope this helps!