Skip to content

Uuid Field

Edit page
PUT /test/uuid/uuid/doc
{
"uuids": {
"cfe052b3-c9d6-43b5-b971-7fdcb5375d6c": "first",
"50ffd30b-6b76-4827-b805-f37f5e95f093": "second",
"b63d5fc1-29ff-4ef0-835f-b5415d7f166d": "third"
}
}
GET /test/uuid/uuid/
INFO /test/uuid/uuid/doc
SEARCH /test/uuid/uuid/
{
"_query": {
"_and": [
{
"uuids.cfe052b3-c9d6-43b5-b971-7fdcb5375d6c": "first"
},
{
"uuids.50ffd30b-6b76-4827-b805-f37f5e95f093": "second"
},
{
"uuids.b63d5fc1-29ff-4ef0-835f-b5415d7f166d": "third"
}
]
}
}

Search uuid field with default by the uuid field

Section titled “Search uuid field with default by the uuid field”
SEARCH /test/uuid/uuid/
{
"_query": {
"uuids.<uuid_field>": "first"
}
}
PUT /test/uuid/uuid_field/doc
{
"uuids": {
"_index_uuid_field": "uuid_field",
"cfe052b3-c9d6-43b5-b971-7fdcb5375d6c": "first",
"50ffd30b-6b76-4827-b805-f37f5e95f093": "second",
"b63d5fc1-29ff-4ef0-835f-b5415d7f166d": "third"
}
}
GET /test/uuid/uuid_field/
INFO /test/uuid/uuid_field/doc
SEARCH /test/uuid/uuid_field/
{
"_query": {
"_and": [
{
"uuids.<uuid_field>": "first"
},
{
"uuids.<uuid_field>": "second"
},
{
"uuids.<uuid_field>": "third"
}
]
}
}

Search uuid field with uuid_field by the uuid

Section titled “Search uuid field with uuid_field by the uuid”
SEARCH /test/uuid/uuid_field/
{
"_query": {
"uuids.cfe052b3-c9d6-43b5-b971-7fdcb5375d6c": "first"
}
}
PUT /test/uuid/both/doc
{
"uuids": {
"_index_uuid_field": "both",
"cfe052b3-c9d6-43b5-b971-7fdcb5375d6c": "first",
"50ffd30b-6b76-4827-b805-f37f5e95f093": "second",
"b63d5fc1-29ff-4ef0-835f-b5415d7f166d": "third",
}
}
GET /test/uuid/both/
INFO /test/uuid/both/doc
SEARCH /test/uuid/both/
{
"_query": {
"_and": [
{
"uuids.cfe052b3-c9d6-43b5-b971-7fdcb5375d6c": "first"
},
{
"uuids.50ffd30b-6b76-4827-b805-f37f5e95f093": "second"
},
{
"uuids.b63d5fc1-29ff-4ef0-835f-b5415d7f166d": "third"
},
{
"uuids.<uuid_field>": "first"
},
{
"uuids.<uuid_field>": "second"
},
{
"uuids.<uuid_field>": "third"
}
]
}
}

Search uuid field with both for a word of another uuid

Section titled “Search uuid field with both for a word of another uuid”
SEARCH /test/uuid/both/
{
"_query": {
"uuids.50ffd30b-6b76-4827-b805-f37f5e95f093": "first"
}
}