Skip to content

Instantly share code, notes, and snippets.

@quoeamaster
Created April 14, 2022 11:21
Show Gist options
  • Save quoeamaster/4fd47af2611aac927d466c9825bb17be to your computer and use it in GitHub Desktop.
Save quoeamaster/4fd47af2611aac927d466c9825bb17be to your computer and use it in GitHub Desktop.
POST courses-03/_bulk
{"index":{"_id":"A123"}}
{"comments":"if you think the course is nice and wanna comment, please send an email to -> donna.karen@uni.gov or jojo.star.crusade@uni.gov . Thx~"}
{"index":{"_id":"b1234"}}
{"comments":"Shout out to the great instructors donnie.yun@uni.gov and blah@uni.gov.uk"}
{"index":{"_id":"cy7L"}}
{"comments":"welcome donna.liselot@uni.gov to join the training team"}
/* no results */
GET courses-03/_search
{
"query": {
"match": {
"comments": "donna"
}
}
}
/* searchable through partial email address values (e.g. donna) */
GET courses-03/_search
{
"query": {
"match": {
"comments.email": "donna"
}
},
"highlight": {
"fields": {
"comments.email": {}
}
}
}
/* only searchable if providing the full exact email address */
GET courses-03/_search
{
"query": {
"match": {
"comments": "donna.liselot@uni.gov"
}
},
"highlight": {
"fields": {
"comments": {}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment