-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[Docs] Convert more doc snippets #26404
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
Conversation
This commit converts some remaining doc snippets so that they are now testable.
| ] | ||
| }, | ||
| { | ||
| "name": "BucketCollector: [[org.elasticsearch.search.profile.aggregation.ProfilingAggregator@222b076, org.elasticsearch.search.profile.aggregation.ProfilingAggregator@3000ab31]]", |
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.
ProfilingAggregator.toString() changed? I'd expect to find the name here.
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 bet it did. This would have caught that it broke user output too.... Might be a nice followup I think.
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.
Yeah, not sure what's going on here. I don't think ProfilingAggregator ever overrode toString() (at least I don't see it in the history anywhere), so I'm not sure how this worked before either :)
In either case we should just delegate to the wrapped collector's name. I'll investigate and open an issue/PR if appropriate.
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.
In either case we should just delegate to the wrapped collector's name. I'll investigate and open an issue/PR if appropriate.
Thanks @polyfractal :)
|
|
||
| 1. The first `TermQuery` (message:search) represents the main `term` query | ||
| 2. The second `TermQuery` (my_field:foo) represents the `post_filter` query | ||
| 3. There is a `MatchAllDocsQuery` (\*:*) query which is being executed as a second, distinct search. This was |
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.
The MatchAllDocsQuery does not appear in the original search query, neither in the updated one. I think the explanation is now obsolete but I'd be happy if someone can confirm/infirm this.
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.
This is kinda odd... I think we have to execute a secondary collector for the global agg (since the first is being filtered by the query).
I think modifying the docs right now is fine, but I'll start chasing why this changed because it could be something wrong with the profiler itself.
nik9000
left a comment
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 can't comment on the profiling snippets. Maybe @polyfractal can have a look?
| ] | ||
| } | ||
| -------------------------------------------------- | ||
| // NOTCONSOLE |
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'd originally thought of // NOTCONSOLE as only for requests that looked like they should be converted to // CONSOLE but can't for some reason, like maybe we're demonstrating how to use curl in the _bulk API.
While the name // NOTCONSOLE isn't really right for this the idea makes sense. We can't assert anything about this response.
So I'm 👍 on doing this here.
docs/reference/docs/reindex.asciidoc
Outdated
| "failures" : [ ] | ||
| } | ||
| -------------------------------------------------- | ||
| // NOTCONSOLE |
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 we can actually test this and the advantage of doing so is that we'll catch if the output of reindex changes.
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.
Right, this snippet is really out of date
| "failures" : [ ] | ||
| } | ||
| -------------------------------------------------- | ||
| // NOTCONSOLE |
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 we can test this too.
| [source,js] | ||
| -------------------------------------------------- | ||
| PUT /my_index | ||
| PUT index |
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've mostly been starting with the / before the first element so it feels more like a url. At first I liked it better without but @clintongormley liked it better with so I went with his way and I've grown used to it.
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.
Sadly we're not coherent in the docs. I changed it here so that it is coherent on the same page.
|
|
||
| [source,js] | ||
| -------------------------------------------------- | ||
| PUT index/_settings |
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.
Maybe just put the POST /index/_close request in the snippet so the users sees it. We tell them to close but it is a fine reminder of how.
| } | ||
| } | ||
| } | ||
| -------------------------------------------------- |
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.
You could even add an _open here.
| Creating new empty translog at [data/nodes/0/indices/P45vf_YQRhqjfwLMUvSqDw/0/translog/translog-3.tlog] | ||
| Done. | ||
| -------------------------------------------------- | ||
| // NOTCONSOLE |
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.
Here I'd change the snippet from [source,js] to [source,txt] which will cause it to skip the detection so you don't need // NOTCONSOLE.
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.
Good catch, I don't remember why I added this NOTCONSOLE
| ] | ||
| }, | ||
| { | ||
| "name": "BucketCollector: [[org.elasticsearch.search.profile.aggregation.ProfilingAggregator@222b076, org.elasticsearch.search.profile.aggregation.ProfilingAggregator@3000ab31]]", |
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 bet it did. This would have caught that it broke user output too.... Might be a nice followup I think.
| ... | ||
| "aggregations": [ | ||
| { | ||
| "type": "org.elasticsearch.search.aggregations.bucket.terms.TermsAggregatorFactory$1", |
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.
Looks like there are more naming issues to iron out in the profiler :(
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.
The docs tests are lovely, aren't they? :)
|
Profiler stuff looks fine to me. There are some oddities for sure, but not a problem with the docs... likely issues with the profiler code itself. I'll chase those down. Thanks for adding these tests @tlrx! |
|
Thanks for doing this! |
|
Thanks @nik9000 @polyfractal |
This commit converts some remaining doc snippets so that they are now testable.
This commit converts some remaining doc snippets so that they are now testable.
This pull request converts some more remaining doc snippets so that they are now testable.
Note: I think it's perfectly fine to have some
// NOTCONSOLEhere and there as long as they are associated to an explanation on why it cannot be tested.