Namespace Queries
Namespaces are enabled by using the _namespace
option during the schema
creation, as explained in the Namespaces
section.
Searching can be done either specifying nesting field names objects or by using
Field Expansion
and joining the field names with dot (‘.
’):
SEARCH /bank/
{
"_query": {
"style": {
"clothing": "*"
}
}
}
SEARCH /bank/
{
"_query": {
"style.hairstyle": "afro"
}
}
SEARCH /bank/
{
"_query": {
"style.clothing.footwear": "casual shoes"
}
}
Partial Paths
By default namespaced fields keep information for each level in the path. For
example, you can also query "footwear"
while skipping "clothing"
, so
queries like the following also work:
SEARCH /bank/
{
"_query": {
"style.footwear": "casual shoes"
}
}