Highlight not Working


(Arulkumar) #1

Hi all,
Here i am search using the range query, i am getting the
result of 8 records but i am not getting the result with highlight for
all documents. Here 2 record's gets higlighted others not get
highlighted.

Search Query:

{ "sort" : [ {"_score" : {"reverse" :true } }, {"myfield1" :
{"reverse" :false } } ] ,"query" : { "bool" : { "must" : [{ "bool" :
{ "should" : [{ "has_child" : {"type" : "included", "query" :
{ "term" : { "_included": "status2status" } }} }] } } ,{ "bool" :
{ "should" : [{ "bool" : { "should" : [{ "range" : { "myfield1" :
{ "from" : "01", "to" : "08","include_lower" : true,"include_upper" :
true,"boost" : 1.0 } } } ,{ "bool" : { "must_not" : [{ "bool" :
{ "should" : [{ "query_string" : { "default_field" : "myfield1",
"query" : "myfield1:*","default_operator" : "OR","analyzer" :
"standard","allow_leading_wildcard" :
true,"lowercase_expanded_terms" : true,"enable_position_increments" :
true,"fuzzy_prefix_length" : 0,"fuzzy_min_sim" : 0.5,"phrase_slop" :
0,"boost" : 1.0 } }] } }] } }] } }] } }] } }, "from" : 0, "size" :
20,"highlight" : { "tags_schema" : "styled" ,"pre_tags" :
[ "" ] ,"post_tags" : [ "" ] ,"fields" : { "myfield1" :
{"number_of_fragments" : 0 },"explain" : false,"fields" :["myfield1"] }


(Shay Banon) #2

Which version of ES are you using? There was a bug that data was not being highlighted properly. Can you create a simple test case and see if it happens with master?
On Saturday, January 29, 2011 at 3:09 PM, Arulkumar wrote:

Hi all,
Here i am search using the range query, i am getting the
result of 8 records but i am not getting the result with highlight for
all documents. Here 2 record's gets higlighted others not get
highlighted.

Search Query:

{ "sort" : [ {"_score" : {"reverse" :true } }, {"myfield1" :
{"reverse" :false } } ] ,"query" : { "bool" : { "must" : [{ "bool" :
{ "should" : [{ "has_child" : {"type" : "included", "query" :
{ "term" : { "_included": "status2status" } }} }] } } ,{ "bool" :
{ "should" : [{ "bool" : { "should" : [{ "range" : { "myfield1" :
{ "from" : "01", "to" : "08","include_lower" : true,"include_upper" :
true,"boost" : 1.0 } } } ,{ "bool" : { "must_not" : [{ "bool" :
{ "should" : [{ "query_string" : { "default_field" : "myfield1",
"query" : "myfield1:*","default_operator" : "OR","analyzer" :
"standard","allow_leading_wildcard" :
true,"lowercase_expanded_terms" : true,"enable_position_increments" :
true,"fuzzy_prefix_length" : 0,"fuzzy_min_sim" : 0.5,"phrase_slop" :
0,"boost" : 1.0 } }] } }] } }] } }] } }] } }, "from" : 0, "size" :
20,"highlight" : { "tags_schema" : "styled" ,"pre_tags" :
[ "" ] ,"post_tags" : [ "" ] ,"fields" : { "myfield1" :
{"number_of_fragments" : 0 },"explain" : false,"fields" :["myfield1"] }


(system) #3