Skip to content

Instantly share code, notes, and snippets.

@juneym
Created July 5, 2011 17:52
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 juneym/1065403 to your computer and use it in GitHub Desktop.
Save juneym/1065403 to your computer and use it in GitHub Desktop.
ElasticSearch's fuzzylikethis not highlighting..
{
"query": {
"fuzzy_like_this": {
"fields": [
"title",
"content",
"tags"
],
"boost": 1.5,
"like_text": "floats",
"min_similarity": 0.5
}
},
"fields": [
"dtmPosted",
"postedBy",
"url",
"content",
"title",
"categories"
],
"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