I am using the Below Query
GET books/_search
{
"query" :
{
"query_string":
{
"query": "java scala"
}
},
"aggs": {
"my_agg": {
"terms": {
"field": "language",
"missing": "N/A"
}
}
},
"highlight": {
"fields": {
"title" : {
"fragment_size" : 15,
"number_of_fragments" : 3,
"fragmenter": "span"
}
}
}
}
I can not see the Highlight tag into the Json Output..My Json Output is as Below:-
{
"took": 6,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 3,
"max_score": 0.7180147,
"hits": [
{
"_index": "books",
"_type": "book",
"_id": "3",
"_score": 0.7180147,
"_source": {
"title": "Programming in Scala: A Comprehensive Step-by-Step Guide, 2nd Edition",
"author": "Martin Odersky",
"language": "Scala",
"publishYear": 2011,
"summary": "Scala is an object-oriented programming language for the Java Virtual Machine. In addition to being object-oriented, Scala is also a functional language, and combines the best approaches to OO and functional programming."
}
},
{
"_index": "books",
"_type": "book",
"_id": "4",
"_score": 0.64829546,
"_source": {
"title": "Hadoop: The Definitive Guide, 4th Edition",
"author": "Tom White",
"language": "Java",
"publishYear": 2015,
"summary": "Get ready to unlock the power of your data. With the fourth edition of this comprehensive guide, you’ll learn how to build and maintain reliable, scalable, distributed systems with Apache Hadoop. This book is ideal for programmers looking to analyze datasets of any size, and for administrators who want to set up and run Hadoop clusters."
}
},
{
"_index": "books",
"_type": "book",
"_id": "1",
"_score": 0.48414356,
"_source": {
"title": "Effective Java",
"author": "Josh Bloch",
"language": "Java",
"publishYear": 2008,
"summary": "Are you looking for a deeper understanding of the Java programming language so that you can write code that is clearer, more correct, more robust, and more reusable? Look no further! Effective Java, Second Edition, brings together seventy-eight indispensable programmer’s rules of thumb: working, best-practice solutions for the programming challenges you encounter every day."
}
}
]
},
"aggregations": {
"my_agg": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "java",
"doc_count": 2
},
{
"key": "scala",
"doc_count": 1
}
]
}
}
}
Pls Guide..