Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip all geo point queries in plain highlighter #18495

Merged
merged 1 commit into from
May 25, 2016

Conversation

brwe
Copy link
Contributor

@brwe brwe commented May 20, 2016

Geo queries and plain highlighter do not seem to work well
together (https://issues.apache.org/jira/browse/LUCENE-7293)
so we need to skip all geo related queries when we highlight.

hopefully closes #17537

Only plain highlighter seems to be affected.
I am worried that we might need to take care of GeoPointInBBoxQueryImpl too although I do not see how a rewritten query can be used for highlighting, see TODO below.

@nik9000 since this was your idea, maybe you want to take a look?

Geo queries and plain highlighter do not seem to work well
together (https://issues.apache.org/jira/browse/LUCENE-7293)
so we need to skip all geo related queries when we highlight.

closes elastic#17537
@nik9000
Copy link
Member

nik9000 commented May 20, 2016

LGTM. Highlighter is all hacks so another one won't hurt. Much.

protected void extract(Query query, float boost, Map<String, WeightedSpanTerm> terms) throws IOException {
// skip all geo queries, see https://issues.apache.org/jira/browse/LUCENE-7293 and
// https://github.com/elastic/elasticsearch/issues/17537
if (query instanceof GeoPointInBBoxQuery == false) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we also expose GeoPointDistanceQuery or GeoPointInPolygonQuery?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, nevermind: both of those queries also subclass GeoPoinInBBoxQuery, so this check is sufficient!

@mikemccand
Copy link
Contributor

I left one comment, else LGTM. Thanks @brwe!

@clintongormley clintongormley added >bug :Search Relevance/Highlighting How a query matched a document labels May 23, 2016
@s1monw
Copy link
Contributor

s1monw commented May 23, 2016

LGTM too

@brwe brwe merged commit 6862c48 into elastic:master May 25, 2016
@clintongormley clintongormley changed the title skip all geo point queries in plain highlighter Skip all geo point queries in plain highlighter May 25, 2016
@brwe
Copy link
Contributor Author

brwe commented May 31, 2016

Backported to 2.x here d2d670d and here 13c3dd8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid shift value (xx) in prefixCoded bytes (is encoded value really a geo point?)
5 participants