Source filtering
Excluding the _source
field altogether
GET /recipe/_search
{
"_source": false,
"query": {
"match": { "title": "pasta" }
}
}
Only returning the created
field
GET /recipe/_search
{
"_source": "created",
"query": {
"match": { "title": "pasta" }
}
}
Only returning an object's key
GET /recipe/_search
{
"_source": "ingredients.name",
"query": {
"match": { "title": "pasta" }
}
}
Returning all of an object's keys
GET /recipe/_search
{
"_source": "ingredients.*",
"query": {
"match": { "title": "pasta" }
}
}
Returning the ingredients
object with all keys, and the servings
field
GET /recipe/_search
{
"_source": [ "ingredients.*", "servings" ],
"query": {
"match": { "title": "pasta" }
}
}
Including all of the ingredients
object's keys, except the name
key
GET /recipe/_search
{
"_source": {
"includes": "ingredients.*",
"excludes": "ingredients.name"
},
"query": {
"match": { "title": "pasta" }
}
}