Closed
Description
Currently you can retrieve stored fields of a search hit using the fields option.
However you cannot use wildcards.
Suppose I have document with several title fields such as "book_title", "chapter_title", "paragraph_title", "section_title" and I want to have all those title fields returned from a query.
It would be nice to have something like this:
{
"fields" : [ "*_title" ],
"query" : {
"term" : { "category" : "quote" }
}
}
No need to specify all the fields and when new title fields are added they are automatically returned.
Wildcard * is already supported when specifying the fields in a multi_match query or when specifying the fields to highlight for example.
A current workaround is using source-filtering, which does allow the * wildcard.
{
"_source": "*_title" ,
"query" : {
"term" : { "category" : "quote" }
}
}