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 support for field aliases. #32172

Merged
merged 9 commits into from
Jul 18, 2018
Merged

Add support for field aliases. #32172

merged 9 commits into from
Jul 18, 2018

Conversation

jtibshirani
Copy link
Contributor

Closes #23714. Merges feature branch tracked in #31372.

* Add basic support for field aliases through a new top-level mapper type.
* Add tests for queries, aggregations, sorting, and fetching doc values.
* Make sure we properly handle wildcard fields in query string queries.
* Allow for aliases when requesting suggestions.
* Allow for aliases when requesting highlights.
* Add a test for field capabilities.
* When loading stored fields, resolve wildcard patterns against the mappings instead of the index.
* Minor simplifications to the logic in FetchPhase.
* Pull out a shared method FetchPhase#getSearchFields.
* Allow for aliases when fetching stored fields.
* Make sure aliases can be referenced through params._fields.
* Make sure aliases can be accessed through 'doc'.
* Convert ExpressionTests to a unit test.
* Perform basic validation on the target of an alias.
* Validate that an alias and its target have the same nested scope.
* Pull out some validation logic into a separate class.
* Validate the uniqueness of field alias mappings.
…pper. (#31671)

* Rename DocumentFieldMappers#getMapper to getFieldMapper.
* Introduce a new DocumentFieldMappers#getMapper that returns a Mapper.
* Fix an issue around field aliases in geo suggestion contexts.
* Make sure a field alias can refer to a percolate query.
* Remove easy-to-fix uses of DocumentFieldMappers#getFieldMapper.
* Include alias mappers in DocumentFieldMappers#getMappers.
* Make sure we detect conflicts between dynamic object mappers and field aliases.
* Throw an exception if aliases are specified as the target of copy_to.
…ses. (#31807)

* Add basic unit tests for field level security with field aliases.
* Ensure that field caps information is filtered when a field alias is provided.
…ons. (#31565)

* Make sure that significant terms aggregations work with field aliases.
* Add a test for ValuesSourceConfig.
* Allow for subclasses of AggregatorTestCase to provide field aliases.
* Add tests for nested and reverse_nested aggregations.
* Add an integration test for nested queries.
* Add an integration test for 'more like this' queries.
* Add tests for querying and loading meta-fields.
* Add unit tests for the relevant query builders.
* Add integration tests for geo polygon and shape queries.
* Fix static analysis violations.
* Document that aliases cannot be used in a query lookup path.
@jtibshirani jtibshirani added >feature :Search Foundations/Mapping Index mappings, including merging and defining field types v7.0.0 labels Jul 18, 2018
@jtibshirani jtibshirani requested a review from jpountz July 18, 2018 14:26
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@jtibshirani
Copy link
Contributor Author

Note that we are still sorting out which 6.x release to target -- I will add another label once we have a conclusion.

Copy link
Contributor

@jpountz jpountz left a comment

Choose a reason for hiding this comment

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

LGTM. I'm happily surprised that alias support didn't require more lines of code (the fact this PR is so large is mostly because of testing). Thank you!

@jtibshirani jtibshirani merged commit 15ff3da into master Jul 18, 2018
@jtibshirani jtibshirani deleted the field-aliases branch July 18, 2018 16:33
@rayafratkina
Copy link

From Kibana point of view, we are concerned that this will impact users in unpredictable ways. We have not had the change to dig into the change to understand what impact it may have, so I would suggest at the very least we SHOULD NOT merge it into 6.x before 6.4 goes out.
We can evaluate the impact and decide if 6.5 is an option

@jtibshirani
Copy link
Contributor Author

Thanks @rayafratkina -- I'll send an internal email to start a discussion around the release target.

@jtibshirani jtibshirani restored the field-aliases branch July 18, 2018 19:58
dnhatn added a commit that referenced this pull request Jul 20, 2018
* master:
  Painless: Simplify Naming in Lookup Package (#32177)
  Handle missing values in painless (#32207)
  add support for write index resolution when creating/updating documents (#31520)
  ECS Task IAM profile credentials ignored in repository-s3 plugin (#31864)
  Remove indication of future multi-homing support (#32187)
  Rest test - allow for snapshots to take 0 milliseconds
  Make x-pack-core generate a pom file
  Rest HL client: Add put watch action (#32026)
  Build: Remove pom generation for plugin zip files (#32180)
  Fix comments causing errors with Java 11
  Fix rollup on date fields that don't support epoch_millis (#31890)
  Detect and prevent configuration that triggers a Gradle bug (#31912)
  [test] port linux package packaging tests (#31943)
  Revert "Introduce a Hashing Processor (#31087)" (#32178)
  Remove empty @return from JavaDoc
  Adjust SSLDriver behavior for JDK11 changes (#32145)
  [test] use randomized runner in packaging tests (#32109)
  Add support for field aliases. (#32172)
  Painless: Fix caching bug and clean up addPainlessClass. (#32142)
  Call setReferences() on custom referring tokenfilters in _analyze (#32157)
  Fix BwC Tests looking for UUID Pre 6.4 (#32158)
  Improve docs for search preferences (#32159)
  use before instead of onOrBefore
  Add more contexts to painless execute api (#30511)
  Add EC2 credential test for repository-s3 (#31918)
  A replica can be promoted and started in one cluster state update (#32042)
  Fix Java 11 javadoc compile problem
  Fix CP for namingConventions when gradle home has spaces (#31914)
  Fix `range` queries on `_type` field for singe type indices (#31756)
  [DOCS] Update TLS on Docker for 6.3 (#32114)
  ESIndexLevelReplicationTestCase doesn't support replicated failures but it's good to know what they are
  Remove versionType from translog (#31945)
  Switch distribution to new style Requests (#30595)
  Build: Skip jar tests if jar disabled
  Painless: Add PainlessClassBuilder (#32141)
  Build: Make additional test deps of check (#32015)
  Disable C2 from using AVX-512 on JDK 10 (#32138)
  Build: Move shadow customizations into common code (#32014)
  Painless: Fix Bug with Duplicate PainlessClasses (#32110)
  Remove empty @param from Javadoc
  Re-disable packaging tests on suse boxes
  Docs: Fix missing example script quote (#32010)
  [ML] Wait for aliases in multi-node tests (#32086)
  [ML] Move analyzer dependencies out of categorization config (#32123)
  Ensure to release translog snapshot in primary-replica resync (#32045)
  Handle TokenizerFactory  TODOs (#32063)
  Relax TermVectors API to work with textual fields other than TextFieldType (#31915)
  Updates the build to gradle 4.9 (#32087)
  Mute :qa:mixed-cluster indices.stats/10_index/Index - all’
  Check that client methods match API defined in the REST spec (#31825)
  Enable testing in FIPS140 JVM (#31666)
  Fix put mappings java API documentation (#31955)
  Add exclusion option to `keep_types` token filter (#32012)
  [Test] Modify assert statement for ssl handshake (#32072)
@jtibshirani jtibshirani deleted the field-aliases branch July 20, 2018 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>feature release highlight :Search Foundations/Mapping Index mappings, including merging and defining field types v6.4.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants