I can't get this to highlight for the life of me. It seems like elastic search is broken with regards to highlighting on fields that are mentioned in a filtered clause. The below query just does not highlight. Is this an issue with Elastic? What can I do to make this work?
{
"query": {
"filtered": {
"query": {
"bool": {
"must": [
{
"term": {
"language": "Austrian"
}
}
]
}
},
"filter": {
"and": [
{
"query": {
"query_string": {
"fields": [
"standard_analyzed_name",
"standard_analyzed_message"
],
"query": "Arnold AND Schwarz"
}
}
}
]
}
}
},
"size": 20,
"sort": [
{
"total_interactions": {
"order": "desc"
}
}
],
"highlight": {
"fields": {
"standard_analyzed_name": {
"pre_tags": [
"<strong>"
],
"post_tags": [
"</strong>"
],
"fragment_size": 500,
"number_of_fragments": 1
},
"standard_analyzed_message": {
"pre_tags": [
"<strong>"
],
"post_tags": [
"</strong>"
],
"fragment_size": 500,
"number_of_fragments": 1
}
}
}
}
UPDATE
The above query does highlight in elastic search 2.0.0 - Yayyy
curl -XGET localhost:9200/facebook_posts/_mapping/document
– Val