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

Add term query for keyword script fields #59372

Merged
merged 4 commits into from
Jul 13, 2020

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Jul 12, 2020

This adds what I think is just about the simplest possible term query
implementation for keyword script fields and wires it into the field
mapper that we build for them.

Relates to #59332

This adds what I think is just about the simplest possible `term` query
implementation for `keyword` script fields and wires it into the field
mapper that we build for them.
@nik9000 nik9000 requested a review from javanna July 12, 2020 15:12
Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

@Override
public float matchCost() {
// TODO we don't have a good way of estimating the complexity of the script so we just go with 9000
return 9000f;
Copy link
Member

Choose a reason for hiding this comment

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

did we say that approximation.cost() was not good here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, Lucene documents this as "An estimate of the expected cost to determine that a single document". So multiplying by the cost of the approximation don't feel right. 9000 is kind of bogus too, but maybe less so.

Copy link
Member

Choose a reason for hiding this comment

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

let's ask @jpountz what he thinks. I thought I remembered discussing with him that the cost could be the cost of the approximation but I may be wrong.

Copy link
Member

Choose a reason for hiding this comment

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

this should not block merging the PR, we can always update the cost later.

Copy link
Member Author

Choose a reason for hiding this comment

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

++

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 a high constant looks good to me

@javanna javanna added the :Search/Search Search-related issues that do not fall into other categories label Jul 13, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Search)

@elasticmachine elasticmachine added the Team:Search Meta label for search team label Jul 13, 2020
@nik9000 nik9000 merged commit 2659648 into elastic:feature/runtime_fields Jul 13, 2020
@javanna javanna mentioned this pull request Jul 15, 2020
30 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants