-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Enforce Completion Context Limit #38675
Conversation
TommyWind
commented
Feb 10, 2019
- Enforcing a maximum number of completion contexts as requested in Limit the number of context mappings #32741
- Closes Limit the number of context mappings #32741
Hi @TommyWind, we have found your signature in our records, but it seems like you have signed with a different e-mail than the one used in yout Git commit. Can you please add both of these e-mails into your Github profile (they can be hidden), so we can match your e-mails to your Github profile? |
* Enforcing a maximum number of completion contexts as reqested in elastic#32741 * Closes elastic#32741
Pinging @elastic/es-search |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @TommyWind , I left a comment regarding where to check the limit.
@@ -497,6 +500,7 @@ static void validateTypeName(String type) { | |||
ContextMapping.validateContextPaths(indexSettings.getIndexVersionCreated(), fieldMappers, fieldTypes::get); | |||
|
|||
if (reason == MergeReason.MAPPING_UPDATE) { | |||
checkCompletionContextsLimit(fieldMappers); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be easier to perform the check directly in CompletionFieldMapper#Builder#build since you have all the needed informations there. We should also not throw an error on old indices (created before 780) since they were created before this breaking change. You can check the created version of the index in the CompletionFieldMapper
with BuilderContext#indexCreatedVersion
and throw an error if the index has been created on or after 8.0 and a deprecation warning otherwise.
@jimczi thanks for taking a look. :) Moved the logic the way you suggested. Could you take another look please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @TommyWind , the change looks good. Can you add a small note in the docs regarding the new limit?:
https://github.com/elastic/elasticsearch/blob/master/docs/reference/search/suggesters/context-suggest.asciidoc
@jimczi thanks, I added a note to the docs. Please take a look when you have some time. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating @TommyWind . I'll run the tests in our CI and I'll merge your pr if they pass.
@elasticmachine test this please |
@jimczi Thanks :) |
Ping @jimczi, looks like it's green now (sorry for the noise, just thought
you might have missed this one :))
Am Mi., 13. Feb. 2019, 10:06 hat Jim Ferenczi <[email protected]>
geschrieben:
… @elasticmachine <https://github.com/elasticmachine> test this please
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#38675 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQ_M0v3RTANJpHnSn7vYVlowwg72tfFlks5vM9V6gaJpZM4azKbU>
.
|
@elasticmachine test this please |
…ate-file * elastic/master: Remove tests and branches that will never execute (elastic#38772) also check ccr stats api return empty response in ensureNoCcrTasks() Add overlapping, before, after filters to intervals query (elastic#38999) Mute test elastic#38949 Add remote recovery to ShardFollowTaskReplicationTests (elastic#39007) [ML] More advanced post-test cleanup of ML indices (elastic#39049) wait for shard to be allocated before executing a resume follow api Update track-total-hits.asciidoc Force kill testcluster nodes (elastic#37353) Make pullFixture a task dependency of resolveAllDependencies (elastic#38956) set minimum supported version (elastic#39043) Enforce Completion Context Limit (elastic#38675) Mute test Don't close caches while there might still be in-flight requests. (elastic#38958) Fix elastic#38623 remove xpack namespace REST API (elastic#38625) Add data frame feature (elastic#38934) Test bi-directional index following during a rolling upgrade. (elastic#38962) Generate mvn pom for ssl-config library (elastic#39019) Mute testRetentionLeaseIsRenewedDuringRecovery
This change adds a limit to the number of completion contexts that a completion field can define. Closes elastic#32741
We have version based logic that applies the limit to number of completion contexts only to indices created from 8.0 on. Those are the only indices we can now have in a cluster, hence we can remove the version based conditional. Relates to elastic#38675
We have version based logic that applies the limit to number of completion contexts only to indices created from 8.0 on. Those are the only indices we can now have in a cluster, hence we can remove the version based conditional. Relates to elastic#38675
We have version based logic that applies the limit to number of completion contexts only to indices created from 8.0 on. Those are the only indices we can now have in a cluster, hence we can remove the version based conditional. Relates to #38675