Last active
December 24, 2019 23:11
-
-
Save dorsev/6b6316bcc34d6806c2c3ceb42ca79614 to your computer and use it in GitHub Desktop.
query on dynamic template field
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X GET "localhost:9200/_search?pretty" -H 'Content-Type: application/json' -d' | |
{ | |
"query": { | |
"match" : { | |
"actions.tags.name" : { | |
"query" : "John" | |
} | |
} | |
} | |
} | |
' | |
# returns 1 match(doc 1) | |
curl -X GET "localhost:9200/_search?pretty" -H 'Content-Type: application/json' -d' | |
{ | |
"query": { | |
"match" : { | |
"actions.tags.lname" : { | |
"query" : "John" | |
} | |
} | |
} | |
} | |
' | |
# returns zero matches | |
# search by value | |
curl -X GET "localhost:9200/_search?pretty" -H 'Content-Type: application/json' -d' | |
{ | |
"query": { | |
"query_string" : { | |
"fields": ["actions.tags.*" ], | |
"query" : "Dor" | |
} | |
} | |
} | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment