Skip to content

Instantly share code, notes, and snippets.

@kanapuli
Created January 1, 2018 01:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kanapuli/1cddeed440aa114ece2050c8d272a2b0 to your computer and use it in GitHub Desktop.
Save kanapuli/1cddeed440aa114ece2050c8d272a2b0 to your computer and use it in GitHub Desktop.
//match query retrieves all documents which has a title like 'Japan%'
{
"_source":["id","name"],
"query":{
"match":{
"title": "Japan"
}
}
}
//match phrase retrieves all documents which matches the complete phrase "Japan is a leader in"
{
"_source":["id","name"],
"query":{
"match_phrase":{
"title": "Japan is a leader in"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment