# Referencing multi-fields on indexing

**URL:** <https://discuss.elastic.co/t/referencing-multi-fields-on-indexing/20192>\
**Category:** Elasticsearch\
**Created:** [October 10, 2014, 9:28pm UTC](https://discuss.elastic.co/t/referencing-multi-fields-on-indexing/20192 "2014-10-10T21:28:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tatu\_Saloranta](https://avatars.discourse-cdn.com/v4/letter/t/d6d6ee/32.png) [@Tatu\_Saloranta](https://discuss.elastic.co/u/Tatu_Saloranta)\
**Post date:** [October 10, 2014, 9:28pm UTC](https://discuss.elastic.co/t/referencing-multi-fields-on-indexing/20192/1 "2014-10-10T21:28:24Z")

</div>

I am trying to figure out a good way to support a use case where an IP  
field needs to be both analyzed and indexed for ipv4 range queries (as type  
'ip'), and stored as-is (as string) for display purpose. It would seem like  
multi-field might work for this.

But one trick is that it turns out that values may also contain ipv6  
values; and as a preparation step, then, we want to just retain "raw"  
value, but omit ipv4 indexable value.

So: instead of feeding a single value (say, "caller-ip") that would then  
have raw string as main value, and 'ip' valued indexed one, it would seem  
necessary to send values separately.  
Still, from modeling perspective, it would seem nice to have the values be  
associated.

So my question is this: is it possible to pass separate values using dotted  
notation when inserting document (so, JSON contain 'caller-ip.caller-ip'  
and 'caller-ip.ipv4') and offer separate values for these sub-fields.  
Or should I just create 2 separate fields, and not try to use multi-fields  
for this case?

So basically: is the dotted notation only applicable when querying values,  
or is it general short-cut that can be used on indexing/insertion side as  
well.

-+T atu +-

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAL4a10h405Va\_hofxwOovMJLr4rsh%2BwOXQe1H7xN8J%3DMo6ssCQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAL4a10h405Va_hofxwOovMJLr4rsh%2BwOXQe1H7xN8J%3DMo6ssCQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:56am UTC](https://discuss.elastic.co/t/referencing-multi-fields-on-indexing/20192/2 "2017-07-06T00:56:56Z")

</div>


