# Questions about multi\_field, configurations, routing control, filtered alias

**URL:** <https://discuss.elastic.co/t/questions-about-multi-field-configurations-routing-control-filtered-alias/15319>\
**Category:** Elasticsearch\
**Created:** [January 20, 2014, 11:21am UTC](https://discuss.elastic.co/t/questions-about-multi-field-configurations-routing-control-filtered-alias/15319 "2014-01-20T11:21:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan\_Ji](https://avatars.discourse-cdn.com/v4/letter/i/d78d45/32.png) [@Ivan\_Ji](https://discuss.elastic.co/u/Ivan_Ji)\
**Post date:** [January 20, 2014, 11:21am UTC](https://discuss.elastic.co/t/questions-about-multi-field-configurations-routing-control-filtered-alias/15319/1 "2014-01-20T11:21:43Z")

</div>

Hi, all

Recently, I am studying the ElasticSearch. I have several questions about  
it. Hope someone can answer me.

(1) About the multi\_field, can it store two type of fields ? such as..

"tweet" : {  
"properties" : {  
"name" : {  
"type" : "multi\_field",  
"fields" : {  
"name" : { "type" : "string", "index" : "not\_analyzed" },  
"value" : { "type" : "int"}

(2) if it can, what's the query format when post a new document? Could I  
explicit specify the value of these two fields? Or there are some type cast  
operations inside it?

(3) Does there any default configuration file exist that configure the  
default schema mappings of the index and type? Does it only support REST  
API to create index/configure the mappings?

(4)After I configured the number of shards/replicas and post many documents  
into it, can I re-configure it again? And how ? if so, what happened when  
the shard number increase? Do it cost a lots of performance?

(5)About the routing, can I control the documents that must be sent to  
different shards? I know I can use the same routing value to index/search  
in the same shard. But could I control some documents which must be located  
in different shards of the other documents?

(6) Assume I have only one node and one index, what's the difference  
between the size of shard is only one and ten of the same index? Does it  
cost extra memory if the shards size is ten? What's the suggested rule to  
decide this size?

(7) What's the difference between setting the search\_type to scroll and  
using the parameters(from/size)?

(8) About the alias filtering, what's the cost about creating a alias  
filter? Are there any cache algorithms to accelerate these operations using  
the alias filter? Or it just append the extra filter condition of the  
filtered alias in the query?

Sorry for the newbie questions, could you give me some opinion about these  
questions?

Cheers,

Ivan

--  
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/a46431bd-cef8-4714-9f08-0445f376b2a1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a46431bd-cef8-4714-9f08-0445f376b2a1%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![binh\_ly1](https://avatars.discourse-cdn.com/v4/letter/b/d26b3c/32.png) [@binh\_ly1](https://discuss.elastic.co/u/binh_ly1)\
**Post date:** [January 20, 2014, 8:52pm UTC](https://discuss.elastic.co/t/questions-about-multi-field-configurations-routing-control-filtered-alias/15319/2 "2014-01-20T20:52:07Z")

</div>

Ivan,

1. The multi\_field type allows you to define different ways that a _single  
field value_ will be indexed. Your example below will work and will index a  
single value as string/not\_analyzed, and then as an int (use "integer" for  
int)

2. The document coming in will contain a field named "name" with a single  
value. When it goes into the index, it will be indexed 2 different ways.

3. A mapping is not required to index data. There is an implied default  
mapping that will parse your JSON content and dynamically update the schema  
if you don't specify one up-front.

4. You cannot change the shard count after the index is created. You can  
change the replica count anytime. The PUT mapping API allows you to change  
the replica count.

5. You can specify a single routing value for all documents that you want  
to go to a specific shard/location.

6. The number of shards will allow you to scale your content later. So if  
your data volume increases, you can add more nodes later and distribute the  
shards around. If you only have a single shard and you run out of space,  
then you cannot scale out unless you increase storage, or increase the  
shard count.

7. Scroll is used to do a snapshot type of search - i.e., results you get  
back will not be affected by updates to the index after you start  
scrolling. From/size are useful if you want to do paging of search results  
(or infinite scrolling but paged at a time).

8. Filters execute fast and yes can be cached.

On Monday, January 20, 2014 6:21:43 AM UTC-5, Ivan Ji wrote:

> Hi, all
> 
> Recently, I am studying the Elasticsearch. I have several questions about  
> it. Hope someone can answer me.
> 
> (1) About the multi\_field, can it store two type of fields ? such as..
> 
> "tweet" : {  
> "properties" : {  
> "name" : {  
> "type" : "multi\_field",  
> "fields" : {  
> "name" : { "type" : "string", "index" : "not\_analyzed" },  
> "value" : { "type" : "int"}
> 
> (2) if it can, what's the query format when post a new document? Could I  
> explicit specify the value of these two fields? Or there are some type cast  
> operations inside it?
> 
> (3) Does there any default configuration file exist that configure the  
> default schema mappings of the index and type? Does it only support REST  
> API to create index/configure the mappings?
> 
> (4)After I configured the number of shards/replicas and post many  
> documents into it, can I re-configure it again? And how ? if so, what  
> happened when the shard number increase? Do it cost a lots of performance?
> 
> (5)About the routing, can I control the documents that must be sent to  
> different shards? I know I can use the same routing value to index/search  
> in the same shard. But could I control some documents which must be located  
> in different shards of the other documents?
> 
> (6) Assume I have only one node and one index, what's the difference  
> between the size of shard is only one and ten of the same index? Does it  
> cost extra memory if the shards size is ten? What's the suggested rule to  
> decide this size?
> 
> (7) What's the difference between setting the search\_type to scroll and  
> using the parameters(from/size)?
> 
> (8) About the alias filtering, what's the cost about creating a alias  
> filter? Are there any cache algorithms to accelerate these operations using  
> the alias filter? Or it just append the extra filter condition of the  
> filtered alias in the query?
> 
> Sorry for the newbie questions, could you give me some opinion about these  
> questions?
> 
> Cheers,
> 
> Ivan

--  
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/faf05ddc-566a-4cc8-9488-7a506c154409%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/faf05ddc-566a-4cc8-9488-7a506c154409%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Binh\_Ly](https://discuss.elastic.co/u/Binh_Ly)\
**Post date:** [January 20, 2014, 9:10pm UTC](https://discuss.elastic.co/t/questions-about-multi-field-configurations-routing-control-filtered-alias/15319/3 "2014-01-20T21:10:10Z")

</div>

Ivan,

1. The multi\_field type allows you to define different ways that a _single  
field value_ will be indexed. Your example below will work and will index a  
single value as string/not\_analyzed, and then as an int (use "integer" for  
int)

2. The document coming in will contain a field named "name" with a single  
value. When it goes into the index, it will be indexed 2 different ways.

3. A mapping is not required to index data. There is an implied default  
mapping that will parse your JSON content and dynamically update the schema  
if you don't specify one up-front.

4. You cannot change the shard count after the index is created. You can  
change the replica count anytime. The PUT mapping API allows you to change  
the replica count.

5. You can specify a single routing value for all documents that you want  
to go to a specific shard/location.

6. The number of shards will allow you to scale your content later. So if  
your data volume increases, you can add more nodes later and distribute the  
shards around. If you only have a single shard and you run out of space,  
then you cannot scale out unless you increase storage, or increase the  
shard count.

7. Scroll is used to do a snapshot type of search - i.e., results you get  
back will not be affected by updates to the index after you start  
scrolling. From/size are useful if you want to do paging of search results  
(or infinite scrolling but paged at a time).

8. Filters execute fast and yes can be cached.

On Monday, January 20, 2014 6:21:43 AM UTC-5, Ivan Ji wrote:

> Hi, all
> 
> Recently, I am studying the Elasticsearch. I have several questions about  
> it. Hope someone can answer me.
> 
> (1) About the multi\_field, can it store two type of fields ? such as..
> 
> "tweet" : {  
> "properties" : {  
> "name" : {  
> "type" : "multi\_field",  
> "fields" : {  
> "name" : { "type" : "string", "index" : "not\_analyzed" },  
> "value" : { "type" : "int"}
> 
> (2) if it can, what's the query format when post a new document? Could I  
> explicit specify the value of these two fields? Or there are some type cast  
> operations inside it?
> 
> (3) Does there any default configuration file exist that configure the  
> default schema mappings of the index and type? Does it only support REST  
> API to create index/configure the mappings?
> 
> (4)After I configured the number of shards/replicas and post many  
> documents into it, can I re-configure it again? And how ? if so, what  
> happened when the shard number increase? Do it cost a lots of performance?
> 
> (5)About the routing, can I control the documents that must be sent to  
> different shards? I know I can use the same routing value to index/search  
> in the same shard. But could I control some documents which must be located  
> in different shards of the other documents?
> 
> (6) Assume I have only one node and one index, what's the difference  
> between the size of shard is only one and ten of the same index? Does it  
> cost extra memory if the shards size is ten? What's the suggested rule to  
> decide this size?
> 
> (7) What's the difference between setting the search\_type to scroll and  
> using the parameters(from/size)?
> 
> (8) About the alias filtering, what's the cost about creating a alias  
> filter? Are there any cache algorithms to accelerate these operations using  
> the alias filter? Or it just append the extra filter condition of the  
> filtered alias in the query?
> 
> Sorry for the newbie questions, could you give me some opinion about these  
> questions?
> 
> Cheers,
> 
> Ivan

--  
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/2b4090fd-eb7d-4f92-acf5-6299d0b17d3b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2b4090fd-eb7d-4f92-acf5-6299d0b17d3b%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan\_Ji](https://avatars.discourse-cdn.com/v4/letter/i/d78d45/32.png) [@Ivan\_Ji](https://discuss.elastic.co/u/Ivan_Ji)\
**Post date:** [January 21, 2014, 1:43am UTC](https://discuss.elastic.co/t/questions-about-multi-field-configurations-routing-control-filtered-alias/15319/4 "2014-01-21T01:43:41Z")

</div>

Hi Bing,

First, really thanks for your reply. According to the replies, I have few  
questions about it below.

Binh Ly於 2014年1月21日星期二UTC+8上午5時10分10秒寫道：

> Ivan,

> 1. The multi\_field type allows you to define different ways that a _single  
> field value_ will be indexed. Your example below will work and will index a  
> single value as string/not\_analyzed, and then as an int (use "integer" for  
> int)
> 
> 2. The document coming in will contain a field named "name" with a single  
> value. When it goes into the index, it will be indexed 2 different ways.
> 
> 3. A mapping is not required to index data. There is an implied default  
> mapping that will parse your JSON content and dynamically update the schema  
> if you don't specify one up-front.
> 
> 4. You cannot change the shard count after the index is created. You can  
> change the replica count anytime. The PUT mapping API allows you to change  
> the replica count.
> 
> 5. You can specify a single routing value for all documents that you want  
> to go to a specific shard/location.

Yes, but can I control the two sets of document must be store in _different_shards? Because if I use different routing values, does it means it can be  
stored in different shard? I guest not, right? Although the hash value of  
these two values are different, I am not sure what the range that the  
routing value belong to a single shard. And I want ti store these documents  
in different shard.

> 1. The number of shards will allow you to scale your content later. So if  
> your data volume increases, you can add more nodes later and distribute the  
> shards around. If you only have a single shard and you run out of space,  
> then you cannot scale out unless you increase storage, or increase the  
> shard count.
> 
> 2. Scroll is used to do a snapshot type of search - i.e., results you get  
> back will not be affected by updates to the index after you start  
> scrolling. From/size are useful if you want to do paging of search results  
> (or infinite scrolling but paged at a time).
> 
> 3. Filters execute fast and yes can be cached.

About filters, I want to know the underlying algorithm. If I create an  
alias which represent about half the index, does it increase the index  
size? I mean if I create aliases, does it operate and store some really  
data about it into the storage? or it just remember the condition and  
process like some predefined adapter which cannot store something stored  
data inside the storage?

Another question:  
What's the suggestion if I need to modify the mapping of some index, such  
as from store="no" to "yes", or remove some field ?  
Because after I read these days, it seems hard to change a existed mapping  
and there are much limitation of it.

Again, thanks for your replies.

Cheers,

Ivan

--  
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/c581704f-8c66-4151-8816-31065867218b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c581704f-8c66-4151-8816-31065867218b%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@Binh\_Ly](https://discuss.elastic.co/u/Binh_Ly)\
**Post date:** [January 21, 2014, 4:57pm UTC](https://discuss.elastic.co/t/questions-about-multi-field-configurations-routing-control-filtered-alias/15319/5 "2014-01-21T16:57:48Z")

</div>

Ivan,

1. You're right, two different routing values may has to the same shard.

2. About ES filters, this might help:  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/all-about-elasticsearch-filter-bitsets/)

About your mapping question, the put mapping api will allow you to update  
existing mappings. It can merge, if your new mapping does not conflict with  
the old one, otherwise, you'll probably need to rebuild the index if there  
is a conflict.

On Monday, January 20, 2014 8:43:41 PM UTC-5, Ivan Ji wrote:

> Hi Bing,
> 
> First, really thanks for your reply. According to the replies, I have few  
> questions about it below.
> 
> Binh Ly於 2014年1月21日星期二UTC+8上午5時10分10秒寫道：
> 
> > Ivan,
> 
> > 1. The multi\_field type allows you to define different ways that a  
> > _single field value_ will be indexed. Your example below will work and will  
> > index a single value as string/not\_analyzed, and then as an int (use  
> > "integer" for int)
> > 
> > 2. The document coming in will contain a field named "name" with a single  
> > value. When it goes into the index, it will be indexed 2 different ways.
> > 
> > 3. A mapping is not required to index data. There is an implied default  
> > mapping that will parse your JSON content and dynamically update the schema  
> > if you don't specify one up-front.
> > 
> > 4. You cannot change the shard count after the index is created. You can  
> > change the replica count anytime. The PUT mapping API allows you to change  
> > the replica count.
> > 
> > 5. You can specify a single routing value for all documents that you want  
> > to go to a specific shard/location.
> 
> Yes, but can I control the two sets of document must be store in  
> _different_ shards? Because if I use different routing values, does it  
> means it can be stored in different shard? I guest not, right? Although the  
> hash value of these two values are different, I am not sure what the range  
> that the routing value belong to a single shard. And I want ti store these  
> documents in different shard.
> 
> > 1. The number of shards will allow you to scale your content later. So if  
> > your data volume increases, you can add more nodes later and distribute the  
> > shards around. If you only have a single shard and you run out of space,  
> > then you cannot scale out unless you increase storage, or increase the  
> > shard count.
> > 
> > 2. Scroll is used to do a snapshot type of search - i.e., results you get  
> > back will not be affected by updates to the index after you start  
> > scrolling. From/size are useful if you want to do paging of search results  
> > (or infinite scrolling but paged at a time).
> > 
> > 3. Filters execute fast and yes can be cached.
> 
> About filters, I want to know the underlying algorithm. If I create an  
> alias which represent about half the index, does it increase the index  
> size? I mean if I create aliases, does it operate and store some really  
> data about it into the storage? or it just remember the condition and  
> process like some predefined adapter which cannot store something stored  
> data inside the storage?
> 
> Another question:  
> What's the suggestion if I need to modify the mapping of some index, such  
> as from store="no" to "yes", or remove some field ?  
> Because after I read these days, it seems hard to change a existed mapping  
> and there are much limitation of it.
> 
> Again, thanks for your replies.
> 
> Cheers,
> 
> Ivan

--  
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/a750c783-4e1e-444a-ab8a-9180cb86303f%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a750c783-4e1e-444a-ab8a-9180cb86303f%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan\_Ji](https://avatars.discourse-cdn.com/v4/letter/i/d78d45/32.png) [@Ivan\_Ji](https://discuss.elastic.co/u/Ivan_Ji)\
**Post date:** [January 22, 2014, 1:33am UTC](https://discuss.elastic.co/t/questions-about-multi-field-configurations-routing-control-filtered-alias/15319/6 "2014-01-22T01:33:22Z")

</div>

Hi, Binh

Thanks for your replies.

So it seems there are no ways to force two document to store in different  
shard.

And I will read the document of the bitsets.

Regards,

Ivan

Binh Ly於 2014年1月22日星期三UTC+8上午12時57分48秒寫道：

> Ivan,
> 
> 1. You're right, two different routing values may has to the same shard.
> 
> 2. About ES filters, this might help:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/all-about-elasticsearch-filter-bitsets/)
> 
> About your mapping question, the put mapping api will allow you to update  
> existing mappings. It can merge, if your new mapping does not conflict with  
> the old one, otherwise, you'll probably need to rebuild the index if there  
> is a conflict.
> 
> On Monday, January 20, 2014 8:43:41 PM UTC-5, Ivan Ji wrote:
> 
> > Hi Bing,
> > 
> > First, really thanks for your reply. According to the replies, I have few  
> > questions about it below.
> > 
> > Binh Ly於 2014年1月21日星期二UTC+8上午5時10分10秒寫道：
> > 
> > > Ivan,
> > 
> > > 1. The multi\_field type allows you to define different ways that a  
> > > _single field value_ will be indexed. Your example below will work and will  
> > > index a single value as string/not\_analyzed, and then as an int (use  
> > > "integer" for int)
> > > 
> > > 2. The document coming in will contain a field named "name" with a  
> > > single value. When it goes into the index, it will be indexed 2 different  
> > > ways.
> > > 
> > > 3. A mapping is not required to index data. There is an implied default  
> > > mapping that will parse your JSON content and dynamically update the schema  
> > > if you don't specify one up-front.
> > > 
> > > 4. You cannot change the shard count after the index is created. You can  
> > > change the replica count anytime. The PUT mapping API allows you to change  
> > > the replica count.
> > > 
> > > 5. You can specify a single routing value for all documents that you  
> > > want to go to a specific shard/location.
> > 
> > Yes, but can I control the two sets of document must be store in  
> > _different_ shards? Because if I use different routing values, does it  
> > means it can be stored in different shard? I guest not, right? Although the  
> > hash value of these two values are different, I am not sure what the range  
> > that the routing value belong to a single shard. And I want ti store these  
> > documents in different shard.
> > 
> > > 1. The number of shards will allow you to scale your content later. So  
> > > if your data volume increases, you can add more nodes later and distribute  
> > > the shards around. If you only have a single shard and you run out of  
> > > space, then you cannot scale out unless you increase storage, or increase  
> > > the shard count.
> > > 
> > > 2. Scroll is used to do a snapshot type of search - i.e., results you  
> > > get back will not be affected by updates to the index after you start  
> > > scrolling. From/size are useful if you want to do paging of search results  
> > > (or infinite scrolling but paged at a time).
> > > 
> > > 3. Filters execute fast and yes can be cached.
> > 
> > About filters, I want to know the underlying algorithm. If I create an  
> > alias which represent about half the index, does it increase the index  
> > size? I mean if I create aliases, does it operate and store some really  
> > data about it into the storage? or it just remember the condition and  
> > process like some predefined adapter which cannot store something stored  
> > data inside the storage?
> > 
> > Another question:  
> > What's the suggestion if I need to modify the mapping of some index, such  
> > as from store="no" to "yes", or remove some field ?  
> > Because after I read these days, it seems hard to change a existed  
> > mapping and there are much limitation of it.
> > 
> > Again, thanks for your replies.
> > 
> > Cheers,
> > 
> > Ivan

--  
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/b44d5db2-6c0e-40cc-9d9f-80acee93d70d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/b44d5db2-6c0e-40cc-9d9f-80acee93d70d%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 1:55am UTC](https://discuss.elastic.co/t/questions-about-multi-field-configurations-routing-control-filtered-alias/15319/7 "2017-07-06T01:55:29Z")

</div>


