The query_string
doesn't support it, but if you can parse the query yourself, you can use multi_match
query and do something like this:
{
"query": {
"nested": {
"path": "bib",
"query": {
"multi_match": {
"query": "XSD",
"fields": ["bib.*"]
}
}
}
}
}
A possible problem with this solution is that if you have any numeric fields in the nested document, you would need to exclude them from the list of fields. It can be achieved by adding prefixes to fields names. For example, you can rename all string fields to start with s_
, in this case you can choose all string fields by using "fields": ["bib.s_*"]
.
Another possible solution is to use parent's _all
fields. You can exclude all parent's fields from the _all
and use _all
exclusively for the nested fields. All nested fields are included into parent's _all
field by default.