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

Boost doesn't seem to work for prefix queries #3754

Closed
nik9000 opened this Issue Sep 20, 2013 · 15 comments

Comments

Projects
None yet
3 participants
@nik9000
Copy link
Contributor

commented Sep 20, 2013

Boosts don't seem to work for prefix queries. See https://gist.github.com/nik9000/6643155

It looks like the queryNorm value is always the inverse of the boost value, cancelling out the boost.

That seems wrong.

@nik9000

This comment has been minimized.

Copy link
Contributor Author

commented Sep 25, 2013

This looks to be caused by ConstantScoreAutoRewrite squashing prefix queries that don't match into empty, unweighted boolean clauses in the query rewrite phase. Those empty boolean clauses have zero weight.

Switching to "rewrite": "constant_score_filter" fixes it for me.

@nik9000

This comment has been minimized.

Copy link
Contributor Author

commented Sep 25, 2013

I filed https://issues.apache.org/jira/browse/LUCENE-5245 but I'm not particularly familiar with lucene's procedures so I'm not sure where to go from here.

@s1monw

This comment has been minimized.

Copy link
Contributor

commented Sep 25, 2013

oh good call! thanks for opening it. This should be fixed in lucene really. it seems uwe is on it though but I will watch it as well.

@ghost ghost assigned s1monw Sep 25, 2013

@s1monw

This comment has been minimized.

Copy link
Contributor

commented Sep 25, 2013

flagged it as 4.6 upgrade - we will leave that open until it's fixed / upgraded

@nik9000

This comment has been minimized.

Copy link
Contributor Author

commented Sep 26, 2013

Fine by me. I'll use my work around until then. Any idea when Elasticsearch will upgrade to get it? Also, is this worth adding to the documentation?

Now that I know what causes it I don't think it effects all prefix queries, just the ones for terms that are in a different combination of fields on different indexes. Because I deal in "rare" terms I see this more than most folks.

@s1monw

This comment has been minimized.

Copy link
Contributor

commented Sep 26, 2013

@nik9000 well we ( @jpountz ) tries to get 4.5 out of the door so I'd guess 8 weeks after that happened? I don't think we need to document that specifically.

@nik9000

This comment has been minimized.

Copy link
Contributor Author

commented Sep 26, 2013

Thanks!

@s1monw

This comment has been minimized.

Copy link
Contributor

commented Sep 26, 2013

@nik9000 FYI we are respinning 4.5 so it will include the patch uwe committed

@nik9000

This comment has been minimized.

Copy link
Contributor Author

commented Sep 26, 2013

I saw! Thanks so much!

@s1monw

This comment has been minimized.

Copy link
Contributor

commented Oct 8, 2013

closing, we upgraded to Lucene 4.5 in e9f3677

@s1monw s1monw closed this Oct 8, 2013

@nik9000

This comment has been minimized.

Copy link
Contributor Author

commented Oct 8, 2013

Yay!

@pbellora

This comment has been minimized.

Copy link

commented Oct 14, 2013

@nik9000 "I don't think it effects all prefix queries, just the ones for terms that are in a different combination of fields on different indexes" - would you mind explaining this further? I'm trying to decide whether to upgrade from 90.3 to 90.5.

@nik9000

This comment has been minimized.

Copy link
Contributor Author

commented Oct 14, 2013

@pbellora this bug will hit you if you do a prefix against multiple fields and not all of those fields contain matching terms on all shards. The results won't be sorted properly.

@pbellora

This comment has been minimized.

Copy link

commented Oct 14, 2013

@nik9000 Okay, thanks for clarifying. I ran your gist with 90.3 and saw the same behavior, so I suppose it can't hurt to upgrade.

@s1monw

This comment has been minimized.

Copy link
Contributor

commented Oct 14, 2013

@pbellora FYI this should be fixed in the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.