WARNING: Version 2.3 of Elasticsearch has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
IPv4 datatype
editIPv4 datatype
editAn ip
field is really a long
field which accepts
IPv4 addresses and indexes them as long
values:
PUT my_index { "mappings": { "my_type": { "properties": { "ip_addr": { "type": "ip" } } } } } PUT my_index/my_type/1 { "ip_addr": "192.168.1.1" } GET my_index/_search { "query": { "range": { "ip_addr": { "gte": "192.168.1.0", "lt": "192.168.2.0" } } } }
Parameters for ip
fields
editThe following parameters are accepted by ip
fields:
Field-level index time boosting. Accepts a floating point number, defaults
to |
|
Should the field be stored on disk in a column-stride fashion, so that it
can later be used for sorting, aggregations, or scripting? Accepts |
|
Whether or not the field value should be included in the
|
|
Should the field be searchable? Accepts |
|
Accepts an IPv4 value which is substituted for any explicit |
|
Controls the number of extra terms that are indexed to make
|
|
Whether the field value should be stored and retrievable separately from
the |
IPv6 addresses are not supported yet.