Bug in Highlighting

Hi

I'm use latest version of ES(0.15) and had some problems with
highlighting.
Data :
{
...
streamType: Feed
message: bla bla bla post bla bla 1 bla
tenantId: 1
...
}

Example of query:
query : { bool : {must : [
{field: {streamType: {query: "Feed"}}},
{wildcard : { message : "post" }}, {term : { tenantId :
"1" }}, {range : {postDate : {...}}} ]}},
highlight : {"
"pre_tags" : ...
"post_tags" : ...
"fields" : {"message" : {"fragment_size" : 200,
"number_of_fragments" : 1}" } }

Result:
bla bla bla post bla bla <Highlighting

1 bla

As you can see in highlight fields only "message" marked as
highlighted, but in results some items highlighted for field tenantId.

Any ideas how to resolve this?

Thanks.

Hi

I'm use latest version of ES(0.15) and had some problems with
highlighting.

Please could you gist a curl recreation of the problem - it's easier
than reading it in an email.

See Elastic Stack and Solutions Help · Forums and Slack | Elastic for an explanation

thanks

clint

sample ES: demo for highlight bug · GitHub

On Feb 21, 3:41 pm, Clinton Gormley clin...@iannounce.co.uk wrote:

Hi

I'm use latest version of ES(0.15) and had some problems with
highlighting.

Please could you gist a curl recreation of the problem - it's easier
than reading it in an email.

Seehttp://www.elasticsearch.com/helpfor an explanation

thanks

clint

here: https://gist.github.com/837120

On Feb 21, 3:41 pm, Clinton Gormley clin...@iannounce.co.uk wrote:

Hi

I'm use latest version of ES(0.15) and had some problems with
highlighting.

Please could you gist a curl recreation of the problem - it's easier
than reading it in an email.

Seehttp://www.elasticsearch.com/helpfor an explanation

thanks

clint

On Mon, 2011-02-21 at 06:37 -0800, resetdel wrote:

here: https://gist.github.com/837120

I haven't used highlighting before, so I'm not sure if this is a bug or
not.

It looks to me like the '1' is being highlighted because you specify
{tenantId: 1} as part of the query, when actually you want it to be
applied as a filter.

I've posted a version using a query of type 'filtered' which highlights
correctly: ES: demo for highlight bug · GitHub

clint

Hi resetdel

It looks to me like the '1' is being highlighted because you specify
{tenantId: 1} as part of the query, when actually you want it to be
applied as a filter.

 Yes i'm think so(because tenantId part of query).

 I am not sure that filter will be good for me, because there
 can be more than 100 000 hits (even more than 1000 000 hits),
 and apply filter to this operation will be less productive than
 query.

On the contrary, you definitely want to use filters - they are faster
than queries because ES doesn't have to calculate the scores.

Filters are very fast indeed

clint

A lot of thanks

On Feb 21, 5:32 pm, Clinton Gormley clin...@iannounce.co.uk wrote:

Hi resetdel

It looks to me like the '1' is being highlighted because you specify
{tenantId: 1} as part of the query, when actually you want it to be
applied as a filter.
Yes i'm think so(because tenantId part of query).

 I am not sure that filter will be good for me, because there
 can be more than 100 000 hits (even more than 1000 000 hits),
 and apply filter to this operation will be less productive than
 query.

On the contrary, you definitely want to use filters - they are faster
than queries because ES doesn't have to calculate the scores.

Filters are very fast indeed

clint