Skip to content

Instantly share code, notes, and snippets.

@mlangenberg
Last active August 29, 2015 14:05
Show Gist options
  • Save mlangenberg/7ff16ce35992e50787f4 to your computer and use it in GitHub Desktop.
Save mlangenberg/7ff16ce35992e50787f4 to your computer and use it in GitHub Desktop.
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 0.10848885,
"hits": [
{
"_index": "test",
"_type": "doc",
"_id": "1",
"_score": 0.10848885,
"_source": {
"tags": [
"one hit tag",
"two foo tag",
"three hit tag",
"four foo tag"
]
},
"highlight": {
"tags": [
"one <em>hit</em> tag",
"three <em>hit</em> tag"
]
}
}
]
}
}
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 0.10848885,
"hits": [
{
"_index": "test",
"_type": "doc",
"_id": "1",
"_score": 0.10848885,
"_source": {
"tags": [
"one <em>hit</em> tag",
"two foo tag",
"three <em>hit</em> tag",
"four foo tag"
]
},
"highlight": {
"tags": [
"one <em>hit</em> tag",
"three <em>hit</em> tag"
]
}
}
]
}
}
PUT /test/doc/1
{
"tags": [
"one hit tag",
"two foo tag",
"three hit tag",
"four foo tag"
]
}
GET /test/doc/_search
{
"query": {
"match": { "tags": "hit"}
},
"highlight": {
"fields": {
"tags": { "number_of_fragments": 0 }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment