Skip to content

ML: changing JobResultsProvider.getForecastRequestStats to support > 1 index #37157

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

Merged

Conversation

benwtrent
Copy link
Member

Blocker for #36643

This is the only place where I could find us using a GetRequest against the results indices. Once we help users migrate the results indices, there will be more than one index behind the job aliased index.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core

@benwtrent
Copy link
Member Author

run gradle build tests 1

.execute().actionGet();
SearchResponse searchResponse = client().prepareSearch(AnomalyDetectorsIndex.jobResultsAliasedName(jobId))
.setQuery(new BoolQueryBuilder()
.filter(new TermQueryBuilder("_id", ForecastRequestStats.documentId(jobId, forecastId))))
Copy link
Member

Choose a reason for hiding this comment

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

You could use an IdsQueryBuilder instead of the TermQueryBuilder and drop the BoolQueryBuilder

Copy link
Member Author

Choose a reason for hiding this comment

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

@davidkyle TIL :D.

SearchRequestBuilder forecastSearch = client.prepareSearch(indexName)
.setTypes(ElasticsearchMappings.DOC_TYPE)
.setQuery(new BoolQueryBuilder()
.filter(new TermQueryBuilder("_id",
Copy link
Member

Choose a reason for hiding this comment

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

Same comment as above

Copy link
Member

@davidkyle davidkyle left a comment

Choose a reason for hiding this comment

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

LGTM

@benwtrent
Copy link
Member Author

run gradle build tests 1

1 similar comment
@benwtrent
Copy link
Member Author

run gradle build tests 1

@benwtrent benwtrent merged commit 1780ced into elastic:master Jan 7, 2019
@benwtrent benwtrent deleted the feature/support-multi-indices-job-results branch January 7, 2019 16:59
benwtrent added a commit that referenced this pull request Jan 7, 2019
…1 index (#37157)

* ML: changing JobResultsProvider.getForecastRequestStats to support more than one index

* moving to use idsQuery()
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Jan 7, 2019
…piration

* elastic/master:
  Removing unused methods in Numbers (elastic#37186)
  Fix setting by time unit (elastic#37192)
  [DOCS] Cleans up xpackml attributes
  ML: fix delayed data annotations on secured cluster (elastic#37193)
  Update version in SearchRequest and related test
  [DOCS] Adds overview and API ref for cluster voting configurations (elastic#36954)
  ML: changing JobResultsProvider.getForecastRequestStats to support > 1 index (elastic#37157)
  Separate out validation of groups of settings (elastic#34184)
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.

4 participants