Skip to content

Object

Edit page
PUT /test/mixed_objects/doc
{
"types": {
"type": "human",
"legs": 2,
"arms": 2,
}
}
GET /test/mixed_objects/
INFO /test/mixed_objects/doc
SEARCH /test/mixed_objects/
{
"_query": {
"_and": [
{
"types.type": "human"
},
{
"types.legs": 2
},
{
"types.arms": 2
}
]
}
}
SEARCH /test/mixed_objects/
{
"_query": {
"_and": [
{
"types.legs": {
"_in": {
"_range": {
"_from": 1,
"_to": 3
}
}
}
},
{
"types.arms": {
"_in": {
"_range": {
"_from": 1,
"_to": 3
}
}
}
}
]
}
}
SEARCH /test/mixed_objects/
{
"_query": {
"types.arms": {
"_in": {
"_range": {
"_from": 5,
"_to": 9
}
}
}
}
}
PUT /test/value_object_nested/doc
{
"types": {
"_value": {
"type": "human",
"legs": 2,
"arms": 2,
"name": {
"first": "John",
"last": "Doe"
}
}
}
}
GET /test/value_object_nested/
PUT /test/object/doc
{
"name": {
"_value": {
"first": "John",
"middle": "R",
"last": "Doe"
}
}
}
GET /test/object/._schema.name
SEARCH /test/object/
{
"_query": {
"_and": [
{
"name.first": "john"
},
{
"name.middle": "r"
},
{
"name.last": "doe"
}
]
}
}
SEARCH /test/object/
{
"_query": {
"name.first": "jane"
}
}
PUT /test/nested_object/doc
{
"name": {
"_value": {
"first": "John",
"middle": "R",
"last": "Doe"
}
}
}
GET /test/nested_object/._schema.name
SEARCH /test/nested_object/
{
"_query": {
"_and": [
{
"name.first": "john"
},
{
"name.middle": "r"
},
{
"name.last": "doe"
}
]
}
}
PUT /test/complex_object/doc
{
"accountNumber": 121931,
"balance": 221.46,
"employer": "Globoil",
"name": {
"firstName": "Michael",
"lastName": "Lee"
},
"age": 24,
"gender": "male",
"contact": {
"address": "630 Victor Road",
"city": "Leyner",
"state": "Indiana",
"postcode": "61952",
"phone": "+1 (924) 594-3216",
"email": "michael.lee@globoil.co.uk"
},
"checkin": {
"_point": {
"_longitude": -95.63079,
"_latitude": 31.76212
}
},
"favoriteFruit": "lemon",
"eyeColor": "blue",
"style": {
"_namespace": true,
"clothing": {
"pants": "khakis",
"shirt": "t-shirt"
},
"hairstyle": "slick back"
},
"personality": {
"_language": "en",
"_value": "A lot can be assumed when you first see Michael Lee, but at the very least you will find out he is elegant and heroic. Of course he is also loyal, passionate and clever, but in a way they are lesser traits and tained by behaviors of being prejudiced as well. His elegance though, this is what he is kind of cherished for. Friends frequently count on this and his excitement in times of need. All in all, Michael has a range of flaws to deal with too. His disruptive nature and insulting nature risk ruining pleasant moods and reach all around. Fortunately his heroic nature helps lighten the blows and moods when needed.",
"_type": "text"
}
}
GET /test/complex_object/._schema
INFO /test/complex_object/doc
SEARCH /test/complex_object/
{
"_query": {
"_and": [
{
"personality": "behavior"
},
{
"personality": "cherish"
},
{
"personality": "elegant"
},
{
"personality": "flaw"
},
{
"personality": "disrupt"
},
{
"personality": "insulting"
},
{
"contact.address": "630"
},
{
"contact.address": "victor"
},
{
"contact.address": "road"
},
{
"contact.city": "leyner"
},
{
"contact.email": "michael"
},
{
"contact.email": "globoil"
},
{
"contact.email": "uk"
},
{
"contact.phone": "594"
},
{
"contact.phone": "3216"
},
{
"contact.postcode": "61952"
},
{
"contact.state": "indiana"
},
{
"employer": "globoil"
},
{
"eyeColor": "blue"
},
{
"favoriteFruit": "lemon"
},
{
"gender": "male"
},
{
"name.firstName": "michael"
},
{
"name.lastName": "lee"
},
{
"style.clothing.pants": "khakis"
},
{
"style.clothing.shirt": "shirt"
},
{
"style.hairstyle": "slick"
},
{
"style.hairstyle": "back"
},
{
"style.pants": "khakis"
},
{
"style.shirt": "shirt"
},
{
"accountNumber": 121931
},
{
"age": 24
},
{
"balance": 221.46
},
{
"accountNumber": {
"_in": {
"_range": {
"_from": 100000,
"_to": 130000
}
}
}
},
{
"age": {
"_in": {
"_range": {
"_from": 20,
"_to": 30
}
}
}
},
{
"balance": {
"_in": {
"_range": {
"_from": 200,
"_to": 250
}
}
}
},
{
"checkin": {
"_point": {
"_longitude": -95.63079,
"_latitude": 31.76212
}
}
}
]
}
}

Search Complex Object for words that are not indexed

Section titled “Search Complex Object for words that are not indexed”
SEARCH /test/complex_object/
{
"_query": {
"_and": [
{
"personality": "behavior"
},
{
"personality": "the"
}
]
}
}
SEARCH /test/complex_object/
{
"_query": {
"age": {
"_in": {
"_range": {
"_from": 30,
"_to": 40
}
}
}
}
}