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 documentation for JSON fields. #35281

Merged
merged 7 commits into from
Nov 9, 2018

Conversation

jtibshirani
Copy link
Contributor

No description provided.

@jtibshirani jtibshirani added >docs General docs changes WIP :Search Foundations/Mapping Index mappings, including merging and defining field types labels Nov 6, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@jtibshirani jtibshirani force-pushed the json-field-docs branch 4 times, most recently from d4184d2 to 1d79ad2 Compare November 6, 2018 07:31
Copy link
Contributor

@colings86 colings86 left a comment

Choose a reason for hiding this comment

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

I left a couple of comments. Thanks for writing this up, its really useful to have documentation early on

The `json` mapping type allows an entire JSON object to be indexed as a single field, with support for simple
queries on the field's contents. A `json` field can be useful for modelling objects with a large number of
distinct subfields whose keys are not known in advance. This type of situation might arise arise when
some data is generated directly by users, or by an external third-party application.
Copy link
Contributor

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 useful to explain a bit more about the trade offs of using this vs explicitly mapping the object. For example one advantage of this is that we expect the resulting index to be smaller with the disadvantage of limited query support and no support for aggregations and sorting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes a lot of sense, I'll expand this section.


Leaf values longer than this limit will not be indexed. Defaults to the maximum integer value
`2147483647` so that no values are skipped. Note that this limit applies to the leaf values
within the JSON field, and not the length of the entire field.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should just state that the default is to not skip values of any length rather than mentioning the explicit value here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will fix, I copied this over from the keyword documentation but reading it over again it is quite strange!

@jtibshirani
Copy link
Contributor Author

@colings86 I think this is ready for another look.

Copy link
Contributor

@colings86 colings86 left a comment

Choose a reason for hiding this comment

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

LGTM but could you make sure all lines are wrapped to 80 characters before merging?

}
--------------------------------
// CONSOLE

Copy link
Member

Choose a reason for hiding this comment

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

It might be better to mark this // TESTSETUP then you don't need to mark the others // TEST[continued].

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@jtibshirani
Copy link
Contributor Author

@elasticmachine run sample packaging tests

@jtibshirani
Copy link
Contributor Author

@elasticmachine run gradle build tests

@jtibshirani jtibshirani merged commit ffe70cb into elastic:object-fields Nov 9, 2018
@jtibshirani jtibshirani deleted the json-field-docs branch November 9, 2018 00:56
jtibshirani added a commit to jtibshirani/elasticsearch that referenced this pull request Nov 9, 2018
* Add documentation for JSON fields.
jtibshirani added a commit that referenced this pull request Nov 30, 2018
* Add documentation for JSON fields.
jtibshirani added a commit that referenced this pull request Dec 5, 2018
* Add documentation for JSON fields.
jtibshirani added a commit that referenced this pull request Dec 13, 2018
* Add documentation for JSON fields.
jtibshirani added a commit that referenced this pull request Mar 6, 2019
* Add documentation for JSON fields.
jtibshirani added a commit that referenced this pull request Mar 7, 2019
* Add documentation for JSON fields.
jtibshirani added a commit that referenced this pull request Mar 9, 2019
* Add documentation for JSON fields.
jtibshirani added a commit that referenced this pull request Mar 11, 2019
* Add documentation for JSON fields.
jtibshirani added a commit that referenced this pull request Mar 14, 2019
* Add documentation for JSON fields.
jtibshirani added a commit that referenced this pull request Mar 19, 2019
* Add documentation for JSON fields.
jtibshirani added a commit to jtibshirani/elasticsearch that referenced this pull request Mar 19, 2019
* Add documentation for JSON fields.
jtibshirani added a commit that referenced this pull request Mar 28, 2019
* Add documentation for JSON fields.
jtibshirani added a commit that referenced this pull request Apr 10, 2019
* Add documentation for JSON fields.
jtibshirani added a commit that referenced this pull request Apr 17, 2019
* Add documentation for JSON fields.
jtibshirani added a commit that referenced this pull request May 1, 2019
* Add documentation for JSON fields.
jtibshirani added a commit that referenced this pull request May 24, 2019
* Add documentation for JSON fields.
jtibshirani added a commit that referenced this pull request May 29, 2019
* Add documentation for JSON fields.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>docs General docs changes :Search Foundations/Mapping Index mappings, including merging and defining field types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants