Skip to content

Instantly share code, notes, and snippets.

@geekpete
Last active June 14, 2018 01:31
Show Gist options
  • Save geekpete/3af4b6789292dc1ce60a9812731ed99e to your computer and use it in GitHub Desktop.
Save geekpete/3af4b6789292dc1ce60a9812731ed99e to your computer and use it in GitHub Desktop.
multimatch across two indices
DELETE /index1,index2/
POST /index1/doc
{
"field1": "dog"
}
POST /index2/doc
{
"field2": "cat"
}
POST /index1/doc
{
"field1": "cow"
}
POST /index2/doc
{
"field2": "horse"
}
POST /index2/doc
{
"field2": "dog"
}
GET /index1,index2/_search
{
"query": {
"multi_match" : {
"query": "dog",
"fields": [ "field1", "field2" ]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment