Highlight in Percolator result


(Brett Anderson) #1

On a percolate request, can the doc be returned with the matched words
highlighted? I tried doing this by specifying highlight settings when I
registered the percolator (using NEST in C#)

private bool RegisterPercolator(string name, string query)
{
var c = this.ConnectedClient;
var r = c.RegisterPercolator(
FilterName,
name,
String.Format(
@"{{
""query"" : {{
""query_string"" : {{
""query"" : ""{0}""
}}
}},
""highlight"" : {{
""fields"" : {{
""some_field"" : {{}}
}}
}}
}}", query)
);
return (r.IsValid && r.OK);
}

I then percolate a document which correctly returns the match, but no
additional highlight information:

{
"ok" : true,
"_index" : "_percolator",
"_type" : "index_name",
"_id" : "xxxx",
"_version" : 1
}

Is there anyway to use the highlight feature with the percolator?


(Shay Banon) #2

No, its only a match/no match thing.

On Thursday, March 1, 2012 at 7:08 AM, Brett Anderson wrote:

On a percolate request, can the doc be returned with the matched words highlighted? I tried doing this by specifying highlight settings when I registered the percolator (using NEST in C#)

private bool RegisterPercolator(string name, string query)
{
var c = this.ConnectedClient;
var r = c.RegisterPercolator(
FilterName,
name,
String.Format(
@"{{
""query"" : {{
""query_string"" : {{
""query"" : ""{0}""
}}
}},
""highlight"" : {{
""fields"" : {{
""some_field"" : {{}}
}}
}}
}}", query)
);
return (r.IsValid && r.OK);
}

I then percolate a document which correctly returns the match, but no additional highlight information:

{
"ok" : true,
"_index" : "_percolator",
"_type" : "index_name",
"_id" : "xxxx",
"_version" : 1
}

Is there anyway to use the highlight feature with the percolator?


(system) #3