Skip to content

Conversation

@nik9000
Copy link
Member

@nik9000 nik9000 commented Apr 26, 2017

We've had QueryDSLDocumentationTests for a while but it had a very
hopeful comment at the top about how we want to make sure that the
example in the query-dsl docs match up with the test but we never
had anything that made sure that they did. This changes that!

Now the examples from the query-dsl docs are all built from the
QueryDSLDocumentationTests. All except for the percolator example
because that is hard to do as it stands now.

To make this easier this change moves QueryDSLDocumentationTests
from core and into the high level rest client. This is useful for
two reasons:

  1. We expect the high level rest client to be able to use the builders.
  2. The code that builds that docs doesn't check out all of
    Elasticsearch. It only checks out certain directories. Since we're
    already including snippets from that directory we don't have to
    make any changes to that process.

Closes #24320

We've had `QueryDSLDocumentationTests` for a while but it had a very
hopeful comment at the top about how we want to make sure that the
example in the query-dsl docs match up with the test but we never
had anything that made *sure* that they did. This changes that!

Now the examples from the query-dsl docs are all built from the
`QueryDSLDocumentationTests`. All except for the percolator example
because that is hard to do as it stands now.

To make this easier this change moves `QueryDSLDocumentationTests`
from core and into the high level rest client. This is useful for
two reasons:
1. We expect the high level rest client to be able to use the builders.
2. The code that builds that docs doesn't check out all of
Elasticsearch. It only checks out certain directories. Since we're
already including snippets from that directory we don't have to
make any changes to that process.

Closes elastic#24320
*/
public class QueryDSLDocumentationTests extends ESTestCase {
public void testBool() {
// tag::bool
Copy link
Member Author

Choose a reason for hiding this comment

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

Grumble.... I moved this file to make it easier for the docs framework to pick up but that made this much harder to review.....

Copy link
Contributor

@clintongormley clintongormley left a comment

Choose a reason for hiding this comment

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

Great work!

Copy link
Contributor

@dadoonet dadoonet left a comment

Choose a reason for hiding this comment

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

That is AWESOME!
Thank you so much Nik for doing it!

@nik9000
Copy link
Member Author

nik9000 commented Apr 27, 2017

Thanks for the reviews! I need to get elastic/docs#172 in or this will break the docs build but I think that is almost ready.

@nik9000 nik9000 changed the title Build that java api docs from a test Build the java query DSL api docs from a test Apr 27, 2017
@nik9000 nik9000 merged commit 732741d into elastic:master May 2, 2017
nik9000 added a commit that referenced this pull request May 2, 2017
I've aligned them all to 70 characters except this one....

Relates to #24354
@nik9000 nik9000 removed the v5.5.0 label May 2, 2017
@nik9000
Copy link
Member Author

nik9000 commented May 2, 2017

I'm not backporting this to 5.x because we don't have the high-level-rest client in 5.x and that is where the test lives.

jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request May 2, 2017
* master: (27 commits)
  Check index sorting with no replica since we cannot ensure that the replica index is ready when forceMerge is called. Closes elastic#24416
  Docs: correct indentation on callout
  Build that java api docs from a test (elastic#24354)
  Move RemoteClusterService into TransportService (elastic#24424)
  Fix license header in WildflyIT.java
  Try not to lose stacktraces (elastic#24426)
  [DOCS] Update XPack Reference URL for 5.4 (elastic#24425)
  Painless: Add tests to check for existence and correct detection of the special Java 9 optimizations: Indified String concat and MethodHandles#ArrayLengthHelper() (elastic#24405)
  Extract a common base class to allow services to listen to remote cluster config updates (elastic#24367)
  Adds check to snapshot repository incompatible-snapshots blob to delete a pre-existing one before attempting to overwrite it.
  Added docs for batched_reduce_size
  Fixes checkstyle errors
  Allow scripted metric agg to access `_score` (elastic#24295)
  [Test] Add unit tests for HDR/TDigest PercentilesAggregators (elastic#24245)
  Fix FieldCaps documentation
  Upgrade to JUnit 4.12 (elastic#23877)
  Set available processors for Netty
  Painless: Fix method references to ctor with the new LambdaBootstrap and cleanup code (elastic#24406)
  Doc test: use propery regex for file size
  [DOCS] Tweak doc test to sync_flush
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>docs General docs changes v6.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants