Skip to content

Instantly share code, notes, and snippets.

@juneym
Created July 5, 2011 17:56
Show Gist options
  • Save juneym/1065424 to your computer and use it in GitHub Desktop.
Save juneym/1065424 to your computer and use it in GitHub Desktop.
highlighting works when "query_string" is used.
{
"query": {
"query_string": {
"query": "floats lsa light"
}
},
"fields": [
"dtmPosted",
"postedBy",
"url",
"content",
"title"
],
"highlight": {
"tags_schema": "styled",
"order": "score",
"number_of_fragments": 3,
"fragment_size": 150,
"fields": {
"title": {},
"content": {}
}
},
"facets": {
"price": {
"range": {
"field": "price",
"ranges": [
{
"to": 49.99
},
{
"from": 50,
"to": 99.99
},
{
"from": 100,
"to": 999.99
},
{
"from": 1000,
"to": 4999.99
},
{
"from": 5000,
"to": 9999.99
},
{
"from": 10000
}
]
}
},
"postedBy": {
"terms": {
"field": "postedBy",
"order": "count",
"size": 30
}
},
"classId": {
"terms": {
"field": "classId",
"order": "count",
"size": 30
}
},
"tags": {
"terms": {
"field": "tags",
"order": "count",
"size": 30
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment