Skip to content

How to set null_value in mapping? #458

@Draqun

Description

@Draqun

Hi.

When I read documentation I found parameter null_value

https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-core-types.html

When there is a (JSON) null value for the field, use the null_value as the field value. Defaults to not adding the field at all.

I want use it because sort option always put records with null on the end of list. I tried do it in this way, but it didn't work.

  settings do
    mapping _all: {} do
      indexes :source_server, type: :string, null_value: ""
      indexes :source_server_agent_number, type: :integer, null_value: 0
    end
  end

Any help would be appreciated.
Best regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions