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

Failure inserting document with explicit null in range field #27845

Closed
presto9292 opened this issue Dec 15, 2017 · 1 comment
Closed

Failure inserting document with explicit null in range field #27845

presto9292 opened this issue Dec 15, 2017 · 1 comment
Labels
help wanted adoptme :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch

Comments

@presto9292
Copy link

presto9292 commented Dec 15, 2017

in 5.6.4 the last PUT statement fails, although it is equivalent to the previous insertions

DELETE model_range_index

PUT model_range_index { "mappings": { "my_type": { "properties": { "my_int": { "type": "integer" }, "my_int_range": { "type": "integer_range" } } } } }

PUT model_range_index/my_type/1 { "my_int": 7 }

PUT model_range_index/my_type/2 { "my_int": 7, "my_int_range": [] }

PUT model_range_index/my_type/3 { "my_int": 7, "my_int_range": null }

This is the error response:

{
  "error": {
    "root_cause": [
      {
        "type": "mapper_parsing_exception",
        "reason": "error parsing field [my_int_range], expected an object but got my_int_range"
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "failed to parse [my_int_range]",
    "caused_by": {
      "type": "mapper_parsing_exception",
      "reason": "error parsing field [my_int_range], expected an object but got my_int_range"
    }
  },
  "status": 400
}
@colings86 colings86 added :Search Foundations/Mapping Index mappings, including merging and defining field types discuss labels Dec 18, 2017
@jpountz jpountz added help wanted adoptme and removed discuss labels Jan 5, 2018
@jpountz
Copy link
Contributor

jpountz commented Jan 5, 2018

Discussed in FixitFriday, agreed this is a bug. We should ignore nulls like we do eg. with numbers or geo points.

liketic added a commit to liketic/elasticsearch that referenced this issue Jan 6, 2018
cbuescher pushed a commit that referenced this issue Jan 10, 2018
Currently when adding a document with a `null` value for a range field,
the range field mapper raises an error. Instead we should ignore null like 
we do eg. with numbers or geo points.

Closes #27845
cbuescher pushed a commit that referenced this issue Jan 10, 2018
Currently when adding a document with a `null` value for a range field,
the range field mapper raises an error. Instead we should ignore null like 
we do eg. with numbers or geo points.

Closes #27845
jasontedor added a commit that referenced this issue Jan 11, 2018
* master: (43 commits)
  Rename core module to server (#28180)
  upgraded jna from 4.4.0-1 to 4.5.1 (#28183)
  [TEST] Do not call RandomizedTest.scaledRandomIntBetween from multiple threads
  Primary send safe commit in file-based recovery (#28038)
  [Docs] Correct response json in rank-eval.asciidoc
  Add scroll parameter to _reindex API (#28041)
  Include all sentences smaller than fragment_size in the unified highlighter (#28132)
  Modifies the JavaAPI docs related to AggregationBuilder
  [Docs] Improvements in script-fields.asciidoc (#28174)
  [Docs] Remove Kerberos/SPNEGO Shield plugin (#28019)
  Ignore null value for range field (#27845) (#28116)
  Fix environment variable substitutions in list setting (#28106)
  docs: Replaces indexed script java api docs with stored script api docs
  test: ensure we endup with a single segment
  Make sure that we don't detect files as maven coordinate when installing a plugin (#28163)
  [Tests] temporary disable meta plugin rest tests #28163
  meta-plugin should install bin and config at the top level (#28162)
  Painless: Add public member read/write access test. (#28156)
  Docs: Clarify password protection support with keystore (#28157)
  [Docs] fix plugin properties inclusion for plugins authors
  ...
jasontedor added a commit that referenced this issue Jan 11, 2018
* 6.x: (41 commits)
  Rename core module to server (#28190)
  [Test] Remove superfluous lines
  [Test] Add skip test for index range field with null values
  upgraded jna from 4.4.0-1 to 4.5.1 (#28183)
  [TEST] Do not call RandomizedTest.scaledRandomIntBetween from multiple threads
  [Docs] Correct response json in rank-eval.asciidoc
  Fix environment variable substitutions in list setting (#28106)
  Add scroll parameter to _reindex API (#28041)
  Include all sentences smaller than fragment_size in the unified highlighter (#28132)
  [Docs] Improvements in script-fields.asciidoc (#28174)
  [Docs] Remove Kerberos/SPNEGO Shield plugin (#28019)
  Ignore null value for range field (#27845) (#28116)
  docs: Replaces indexed script java api docs with stored script api docs
  test: ensure we endup with a single segment
  Make sure that we don't detect files as maven coordinate when installing a plugin (#28163)
  [Tests] temporary disable meta plugin rest tests #28163
  meta-plugin should install bin and config at the top level (#28162)
  Painless: Add public member read/write access test. (#28156)
  Docs: Clarify password protection support with keystore (#28157)
  [Docs] fix plugin properties inclusion for plugins authors
  ...
jasontedor added a commit to jasontedor/elasticsearch that referenced this issue Jan 13, 2018
* master: (30 commits)
  Fix lock accounting in releasable lock
  Add ability to associate an ID with tasks  (elastic#27764)
  [DOCS] Removed differencies between text and code (elastic#27993)
  text fixes (elastic#28136)
  Update getting-started.asciidoc (elastic#28145)
  [Docs] Spelling fix in painless-getting-started.asciidoc (elastic#28187)
  Fixed the cat.health REST test to accept 4ms, not just 4.0ms (elastic#28186)
  Do not keep 5.x commits once having 6.x commits (elastic#28188)
  Rename core module to server (elastic#28180)
  upgraded jna from 4.4.0-1 to 4.5.1 (elastic#28183)
  [TEST] Do not call RandomizedTest.scaledRandomIntBetween from multiple threads
  Primary send safe commit in file-based recovery (elastic#28038)
  [Docs] Correct response json in rank-eval.asciidoc
  Add scroll parameter to _reindex API (elastic#28041)
  Include all sentences smaller than fragment_size in the unified highlighter (elastic#28132)
  Modifies the JavaAPI docs related to AggregationBuilder
  [Docs] Improvements in script-fields.asciidoc (elastic#28174)
  [Docs] Remove Kerberos/SPNEGO Shield plugin (elastic#28019)
  Ignore null value for range field (elastic#27845) (elastic#28116)
  Fix environment variable substitutions in list setting (elastic#28106)
  ...
@javanna javanna added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted adoptme :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

4 participants