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

[BUG?] Field mapping type supported properties removed in master #61563

Closed
russcam opened this issue Aug 26, 2020 · 7 comments
Closed

[BUG?] Field mapping type supported properties removed in master #61563

russcam opened this issue Aug 26, 2020 · 7 comments
Assignees
Labels
>bug :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch

Comments

@russcam
Copy link
Contributor

russcam commented Aug 26, 2020

From an internal conversation with @romseygeek, there may be some changes in supported properties from some refactoring to field mapping types taking place in the master branch. I'm opening this issue to raise the ones that we have seen from the integration tests of the .NET client.

Kindly note, the client integration tests are typically exhaustive in setting all field mapping properties available and there's an open issue to refactor the type mapping hierarchy in the client (elastic/elasticsearch-net#3145) as we're aware that some inherited properties are not valid for all derived types. As such, some of the below properties maybe shouldn't have been supported anyway i.e. ignored by Elasticsearch if passed, but I thought it would be better to list all the errors seen in our integration tests than not.

ip field mapping type

  • boost no longer supported

keyword field mapping type

  • similarity no longer supported

boolean field mapping type

  • similarity no longer supported

date field mapping type

  • similarity no longer supported

binary field mapping type

  • similarity no longer supported

number field mapping types (integer, scaled_float, etc.)

  • similarity no longer supported
  • boost no longer supported
@russcam russcam added >bug needs:triage Requires assignment of a team area label labels Aug 26, 2020
@jtibshirani jtibshirani added :Search Foundations/Mapping Index mappings, including merging and defining field types and removed needs:triage Requires assignment of a team area label labels Aug 26, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Mapping)

@elasticmachine elasticmachine added the Team:Search Meta label for search team label Aug 26, 2020
@romseygeek
Copy link
Contributor

Thanks for opening @russcam !

  • boost no longer being supported is definitely an error, and I will open a PR to fix these asap.
  • similarity should still be supported on keyword fields - can you explain the error you're seeing here in more detail?
  • similarity on boolean, date, binary and number fields is indeed gone in master, and issues deprecation warnings when used in 7x

@romseygeek
Copy link
Contributor

I've found the problem on similarity for keyword fields, to do with serialization - something that is not currently covered in our unit tests. I'm looking at improving the test coverage for all mapper parameters in general, so this is more grist to the mill!

@russcam
Copy link
Contributor Author

russcam commented Aug 27, 2020

Thanks for your effort, @romseygeek!

The keyword mapping test failure was (stack_trace has been removed in what we recorded, sorry), in case it helps

"failed to serialize source for type [_doc]" CausedBy: "Type: illegal_argument_exception Reason: "cannot write xcontent for unknown value of type class org.elasticsearch.index.similarity.SimilarityProvider"
[xUnit.net 00:09:12.4484342]     Tests.Mapping.Types.Core.Keyword.KeywordPropertyTests.ReturnsExpectedIsValid [FAIL]
  X Tests.Mapping.Types.Core.Keyword.KeywordPropertyTests.ReturnsExpectedIsValid [57s 810ms]
  Error Message:
   Tests.Framework.EndpointTests.ResponseAssertionException : Expected response.IsValid to be True because Invalid NEST response built from a unsuccessful (500) low level call on PUT: /nest-fluent-10f45c92/_mapping?pretty=true&error_trace=true
# Audit trail of this API call:
 - [1] BadResponse: Node: http://localhost:9200/ Took: 00:00:00.6964628
# OriginalException: Elasticsearch.Net.ElasticsearchClientException: Request failed to execute. Call: Status code 500 from: PUT /nest-fluent-10f45c92/_mapping?pretty=true&error_trace=true. ServerError: Type: generation_exception Reason: "failed to serialize source for type [_doc]" CausedBy: "Type: illegal_argument_exception Reason: "cannot write xcontent for unknown value of type class org.elasticsearch.index.similarity.SimilarityProvider""
# Request:
{"properties":{"state":{"boost":1.2,"eager_global_ordinals":true,"ignore_above":50,"index":false,"index_options":"freqs","normalizer":"myCustom","norms":false,"null_value":"null","doc_values":false,"fields":{"foo":{"ignore_above":10,"type":"keyword"}},"similarity":"BM25","store":true,"type":"keyword"}}}
# Response:
{
  "error" : {
    "root_cause" : [
      {
        "type" : "generation_exception",
        "reason" : "failed to serialize source for type [_doc]",
        "stack_trace" : ""
  },
  "status" : 500
}

romseygeek added a commit that referenced this issue Sep 2, 2020
This commit adds a test to MapperTestCase that explicitly checks that a mapper can
serialize all its default values, and that this serialization can then be re-parsed. Note that
the test is disabled for non-parametrized mappers as their serialization may in some cases
output parameters that are not accepted. Gradually moving all mappers to parametrized
form will address this.

The commit also contains a fix to keyword mappers, which were not correctly serializing
the similarity parameter; this partially addresses #61563. It also enables `null` as a 
value for `null_value` on `scaled_float`, as a follow-up to #61798
romseygeek added a commit to romseygeek/elasticsearch that referenced this issue Sep 2, 2020
…ic#61844)

This commit adds a test to MapperTestCase that explicitly checks that a mapper can
serialize all its default values, and that this serialization can then be re-parsed. Note that
the test is disabled for non-parametrized mappers as their serialization may in some cases
output parameters that are not accepted. Gradually moving all mappers to parametrized
form will address this.

The commit also contains a fix to keyword mappers, which were not correctly serializing
the similarity parameter; this partially addresses elastic#61563. It also enables `null` as a
value for `null_value` on `scaled_float`, as a follow-up to elastic#61798
romseygeek added a commit that referenced this issue Sep 3, 2020
… (#61877)

This commit adds a test to MapperTestCase that explicitly checks that a mapper can
serialize all its default values, and that this serialization can then be re-parsed. Note that
the test is disabled for non-parametrized mappers as their serialization may in some cases
output parameters that are not accepted. Gradually moving all mappers to parametrized
form will address this.

The commit also contains a fix to keyword mappers, which were not correctly serializing
the similarity parameter; this partially addresses #61563. It also enables `null` as a
value for `null_value` on `scaled_float`, as a follow-up to #61798
@romseygeek
Copy link
Contributor

As a heads up: I have a PR (#62623) open to deprecate boost in 7x, which will be followed by a PR removing boost entirely in 8x. One the first PR is merged you may start to see warnings if you are still building mappings in tests that include a boost parameter.

@romseygeek
Copy link
Contributor

I think we can close this now @russcam? similarity should work correctly and boost issues deprecation warnings in 7x and is removed in master.

@jtibshirani
Copy link
Contributor

Closing this out, feel free to reopen if there's still an issue!

@javanna javanna added Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch and removed Team:Search Meta label for search team labels Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch
Projects
None yet
Development

No branches or pull requests

5 participants