PUT my_index | |
{ | |
"mappings": { | |
"properties": { | |
"securityTags": { | |
"type": "keyword", | |
"fields": { | |
"length": { | |
"type": "token_count", | |
"analyzer": "standard" | |
} | |
} | |
} | |
} | |
} | |
} | |
POST /my_index/1 | |
{ | |
"sensitiveData": "Dave Erickson lives in Wahshington DC" | |
"securityTags": ["DaveLocation", "DaveFullName"] | |
} | |
POST /_xpack/security/role/dave_security_role | |
{ | |
cluster: [], | |
"indices": [ | |
{ | |
"names": ["my_index"], | |
"privileges": ["read"], | |
"query": { | |
"terms_set": { | |
"securityTags": { | |
terms: ["DaveFullName", "DaveLocation", "DaveCatNames"], | |
minimum_should_match_field: "securityTags.length" | |
} | |
} | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
@derickson The problem with the
token_count
is that it's counting tokens, not counting the length of thesecurityTags
list. See this full example