# InvalidIndexNameException must not contain whitespace

**URL:** <https://discuss.elastic.co/t/invalidindexnameexception-must-not-contain-whitespace/4590>\
**Category:** Elasticsearch\
**Created:** [June 9, 2011, 7:54pm UTC](https://discuss.elastic.co/t/invalidindexnameexception-must-not-contain-whitespace/4590 "2011-06-09T19:54:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jack\_Park](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jack_park/32/30787_2.png) [@Jack\_Park](https://discuss.elastic.co/u/Jack_Park)\
**Post date:** [June 9, 2011, 7:54pm UTC](https://discuss.elastic.co/t/invalidindexnameexception-must-not-contain-whitespace/4590/1 "2011-06-09T19:54:29Z")

</div>

Sent again from my email account: the message I posted online is hung  
up in approval even though I registered, and it's followed by two spam  
messages. I missed the "subscribe" part after registering.

Running 0.16.2 on win7 conversing through Apache HttpClient.  
Can create a new index

Trouble putting a mapping. Mapping string sent as built from XContentFactory is:  
'{"email":{"properties":{"from":{"type":"string","store":"yes"},"subject":{"type":"string","store":"yes"},"body":{"type":"string","store":"yes"},"date":{"type":"string","store":"yes"},"tags":{"type":"string","store":"yes"},"id":{"type":"string","store":"yes"},"parentId":{"type":"string","store":"yes"}}}}'

I run the query string through URLEncoder.encode so it looks like this:  
topicquests%2Femail%2F\_mapping%27+-d+%7B%22email%22%3A%7B%22from%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22subject%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22body%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22date%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22tags%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22id%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22parentId%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%7D%7D

If I don't run it through URLEncode, it still crashes.  
What the log shows is this:

DEBUG 2011-06-08 17:59:07,225 [main] - \<\<  
"{"error":"InvalidIndexNameException[[topicquests/email/\_mapping' -d  
'{"email":{"properties":{"from":{"type":"string","store":"yes"},"subject":{"type":"string","store":"yes"},"body":{"type":"string","store":"yes"},"date":{"type":"string","store":"yes"},"tags":{"type":"string","store":"yes"},"id":{"type":"string","store":"yes"},"parentId":{"type":"string","store":"yes"}}}}']  
Invalid index name [topicquests/email/\_mapping' -d  
'{"email":{"properties":{"from":{"type":"string","store":"yes"},"subject":{"type":"string","store":"yes"},"body":{"type":"string","store":"yes"},"date":{"type":"string","store":"yes"},"tags":{"type":"string","store":"yes"},"id":{"type":"string","store":"yes"},"parentId":{"type":"string","store":"yes"}}}}'],  
must not contain whitespace]","status":400}"

What am I missing?  
Many thanks.

---

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [June 9, 2011, 8:27pm UTC](https://discuss.elastic.co/t/invalidindexnameexception-must-not-contain-whitespace/4590/2 "2011-06-09T20:27:13Z")

</div>

I think you need to POST the string ...

Why not using the Java API or via a curl script?

On Jun 9, 9:54 pm, Jack Park [jackp...@gmail.com](mailto:jackp...@gmail.com) wrote:

> Sent again from my email account: the message I posted online is hung  
> up in approval even though I registered, and it's followed by two spam  
> messages. I missed the "subscribe" part after registering.
> 
> Running 0.16.2 on win7 conversing through Apache HttpClient.  
> Can create a new index
> 
> Trouble putting a mapping. Mapping string sent as built from XContentFactory is:  
> '{"email":{"properties":{"from":{"type":"string","store":"yes"},"subject":{"type":"string","store":"yes"},"body":{"type":"string","store":"yes"},"date":{"type":"string","store":"yes"},"tags":{"type":"string","store":"yes"},"id":{"type":"string","store":"yes"},"parentId":{"type":"string","store":"yes"}}}}'
> 
> I run the query string through URLEncoder.encode so it looks like this:  
> topicquests%2Femail%2F\_mapping%27+-d+%7B%22email%22%3A%7B%22from%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22subject%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22body%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22date%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22tags%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22id%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22parentId%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%7D%7D
> 
> If I don't run it through URLEncode, it still crashes.  
> What the log shows is this:
> 
> DEBUG 2011-06-08 17:59:07,225 [main] - \<\<  
> "{"error":"InvalidIndexNameException[[topicquests/email/\_mapping' -d  
> '{"email":{"properties":{"from":{"type":"string","store":"yes"},"subject":{"type":"string","store":"yes"},"body":{"type":"string","store":"yes"},"date":{"type":"string","store":"yes"},"tags":{"type":"string","store":"yes"},"id":{"type":"string","store":"yes"},"parentId":{"type":"string","store":"yes"}}}}']  
> Invalid index name [topicquests/email/\_mapping' -d  
> '{"email":{"properties":{"from":{"type":"string","store":"yes"},"subject":{"type":"string","store":"yes"},"body":{"type":"string","store":"yes"},"date":{"type":"string","store":"yes"},"tags":{"type":"string","store":"yes"},"id":{"type":"string","store":"yes"},"parentId":{"type":"string","store":"yes"}}}}'],  
> must not contain whitespace]","status":400}"
> 
> What am I missing?  
> Many thanks.

---

<div class="post-metadata">

**Author:** ![Jack\_Park](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jack_park/32/30787_2.png) [@Jack\_Park](https://discuss.elastic.co/u/Jack_Park)\
**Post date:** [June 9, 2011, 8:35pm UTC](https://discuss.elastic.co/t/invalidindexnameexception-must-not-contain-whitespace/4590/3 "2011-06-09T20:35:29Z")

</div>

Thanks!  
I guess I got confused. the API [1] says this:

curl -XPUT '[http://localhost:9200/twitter/tweet/\_mapping](http://localhost:9200/twitter/tweet/_mapping)' -d ...

and I am using Apache HttpPut for the command.

I just switched to HttpPost for the command: same error.

Did I miss another page that says something else?

(I am doing everything programmatically from a Java program--no  
opportunity to hand use curl)

Jack  
[1] [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-put-mapping.html)

On Thu, Jun 9, 2011 at 1:27 PM, Karussell [tableyourtime@googlemail.com](mailto:tableyourtime@googlemail.com) wrote:

> I think you need to POST the string ...
> 
> Why not using the Java API or via a curl script?
> 
> On Jun 9, 9:54 pm, Jack Park [jackp...@gmail.com](mailto:jackp...@gmail.com) wrote:
> 
> > Sent again from my email account: the message I posted online is hung  
> > up in approval even though I registered, and it's followed by two spam  
> > messages. I missed the "subscribe" part after registering.
> > 
> > Running 0.16.2 on win7 conversing through Apache HttpClient.  
> > Can create a new index
> > 
> > Trouble putting a mapping. Mapping string sent as built from XContentFactory is:  
> > '{"email":{"properties":{"from":{"type":"string","store":"yes"},"subject":{"type":"string","store":"yes"},"body":{"type":"string","store":"yes"},"date":{"type":"string","store":"yes"},"tags":{"type":"string","store":"yes"},"id":{"type":"string","store":"yes"},"parentId":{"type":"string","store":"yes"}}}}'
> > 
> > I run the query string through URLEncoder.encode so it looks like this:  
> > topicquests%2Femail%2F\_mapping%27+-d+%7B%22email%22%3A%7B%22from%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22subject%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22body%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22date%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22tags%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22id%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22parentId%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%7D%7D
> > 
> > If I don't run it through URLEncode, it still crashes.  
> > What the log shows is this:
> > 
> > DEBUG 2011-06-08 17:59:07,225 [main] - \<\<  
> > "{"error":"InvalidIndexNameException[[topicquests/email/\_mapping' -d  
> > '{"email":{"properties":{"from":{"type":"string","store":"yes"},"subject":{"type":"string","store":"yes"},"body":{"type":"string","store":"yes"},"date":{"type":"string","store":"yes"},"tags":{"type":"string","store":"yes"},"id":{"type":"string","store":"yes"},"parentId":{"type":"string","store":"yes"}}}}']  
> > Invalid index name [topicquests/email/\_mapping' -d  
> > '{"email":{"properties":{"from":{"type":"string","store":"yes"},"subject":{"type":"string","store":"yes"},"body":{"type":"string","store":"yes"},"date":{"type":"string","store":"yes"},"tags":{"type":"string","store":"yes"},"id":{"type":"string","store":"yes"},"parentId":{"type":"string","store":"yes"}}}}'],  
> > must not contain whitespace]","status":400}"
> > 
> > What am I missing?  
> > Many thanks.

---

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [June 9, 2011, 8:47pm UTC](https://discuss.elastic.co/t/invalidindexnameexception-must-not-contain-whitespace/4590/4 "2011-06-09T20:47:04Z")

</div>

Hi Jack,

I meant you could use the 'real' Java API without any raw stuff or  
Apache libs:

Settings s = ImmutableSettings.settingsBuilder().put("cluster.name",  
cluster).build();  
TransportClient tmp = new TransportClient(s);  
tmp.addTransportAddress(new InetSocketTransportAddress(url, port));

// with the next line you need to create the mapping structure  
XContentBuilder b =  
JsonXContent.unCachedContentBuilder().field("someField", "value");  
// ... and eventually call b.startObject before + b.endObject after  
this

client.admin().indices().preparePutMapping("indexName").setSource(b);

On Jun 9, 10:35 pm, Jack Park [jackp...@gmail.com](mailto:jackp...@gmail.com) wrote:

> Thanks!  
> I guess I got confused. the API [1] says this:
> 
> curl -XPUT '[http://localhost:9200/twitter/tweet/\_mapping'-d](http://localhost:9200/twitter/tweet/_mapping'-d) ...
> 
> and I am using Apache HttpPut for the command.
> 
> I just switched to HttpPost for the command: same error.
> 
> Did I miss another page that says something else?
> 
> (I am doing everything programmatically from a Java program--no  
> opportunity to hand use curl)
> 
> Jack  
> [1][Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-put-ma)...
> 
> On Thu, Jun 9, 2011 at 1:27 PM, Karussell [tableyourt...@googlemail.com](mailto:tableyourt...@googlemail.com) wrote:
> 
> > I think you need to POST the string ...
> 
> > Why not using the Java API or via a curl script?
> 
> > On Jun 9, 9:54 pm, Jack Park [jackp...@gmail.com](mailto:jackp...@gmail.com) wrote:
> > 
> > > Sent again from my email account: the message I posted online is hung  
> > > up in approval even though I registered, and it's followed by two spam  
> > > messages. I missed the "subscribe" part after registering.
> 
> > > Running 0.16.2 on win7 conversing through Apache HttpClient.  
> > > Can create a new index
> 
> > > Trouble putting a mapping. Mapping string sent as built from XContentFactory is:  
> > > '{"email":{"properties":{"from":{"type":"string","store":"yes"},"subject":{"type":"string","store":"yes"},"body":{"type":"string","store":"yes"},"date":{"type":"string","store":"yes"},"tags":{"type":"string","store":"yes"},"id":{"type":"string","store":"yes"},"parentId":{"type":"string","store":"yes"}}}}'
> 
> > > I run the query string through URLEncoder.encode so it looks like this:  
> > > topicquests%2Femail%2F\_mapping%27+-d+%7B%22email%22%3A%7B%22from%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22subject%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22body%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22date%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22tags%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22id%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%2C%22parentId%22%3A%7B%22type%22%3A%22string%22%2C%22store%22%3A%22yes%22%7D%7D%7D
> 
> > > If I don't run it through URLEncode, it still crashes.  
> > > What the log shows is this:
> 
> > > DEBUG 2011-06-08 17:59:07,225 [main] - \<\<  
> > > "{"error":"InvalidIndexNameException[[topicquests/email/\_mapping' -d  
> > > '{"email":{"properties":{"from":{"type":"string","store":"yes"},"subject":{"type":"string","store":"yes"},"body":{"type":"string","store":"yes"},"date":{"type":"string","store":"yes"},"tags":{"type":"string","store":"yes"},"id":{"type":"string","store":"yes"},"parentId":{"type":"string","store":"yes"}}}}']  
> > > Invalid index name [topicquests/email/\_mapping' -d  
> > > '{"email":{"properties":{"from":{"type":"string","store":"yes"},"subject":{"type":"string","store":"yes"},"body":{"type":"string","store":"yes"},"date":{"type":"string","store":"yes"},"tags":{"type":"string","store":"yes"},"id":{"type":"string","store":"yes"},"parentId":{"type":"string","store":"yes"}}}}'],  
> > > must not contain whitespace]","status":400}"
> 
> > > What am I missing?  
> > > Many thanks.

---

<div class="post-metadata">

**Author:** ![Jack\_Park](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jack_park/32/30787_2.png) [@Jack\_Park](https://discuss.elastic.co/u/Jack_Park)\
**Post date:** [June 9, 2011, 9:53pm UTC](https://discuss.elastic.co/t/invalidindexnameexception-must-not-contain-whitespace/4590/5 "2011-06-09T21:53:25Z")

</div>

Ok. Failed to discover that option. Trying it now.

with url = "[http://localhost](http://localhost)" or "/localhost" I see  
UnresolvedAddressException  
with url = "localhost" or "10.1.10.180" (which is published by ec)  
and port = 9200

at: client.addTransportAddress(new InetSocketTransportAddress(url, port));

the system hangs and goes nowhere.

One other point: using the mobz-elasticsearch-head javascript browser,  
the index is visible and performing just fine.

Not sure why it's hanging.  
One other modest question while we are here: do I need to do  
URLencoding when going through this transport mechanism?

Thanks  
Jack

On Thu, Jun 9, 2011 at 1:47 PM, Karussell [tableyourtime@googlemail.com](mailto:tableyourtime@googlemail.com) wrote:

> Hi Jack,
> 
> I meant you could use the 'real' Java API without any raw stuff or  
> Apache libs:
> 
> Settings s = ImmutableSettings.settingsBuilder().put("cluster.name",  
> cluster).build();  
> TransportClient tmp = new TransportClient(s);  
> tmp.addTransportAddress(new InetSocketTransportAddress(url, port));
> 
> // with the next line you need to create the mapping structure  
> XContentBuilder b =  
> JsonXContent.unCachedContentBuilder().field("someField", "value");  
> // ... and eventually call b.startObject before + b.endObject after  
> this
> 
> client.admin().indices().preparePutMapping("indexName").setSource(b);

---

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [June 9, 2011, 10:13pm UTC](https://discuss.elastic.co/t/invalidindexnameexception-must-not-contain-whitespace/4590/6 "2011-06-09T22:13:56Z")

</div>

> UnresolvedAddressException

use 9300

if that does not help try using 127.0.0.1

Have a look:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

> mobz-elasticsearch-head

ah, yes, that was a good idea 🙂

> do I need to do URLencoding when going through this transport mechanism?

no, as ES uses json (or a special version of it called smile, thats  
why you need the different port 9300 for the java client)

On Jun 9, 11:53 pm, Jack Park [jackp...@gmail.com](mailto:jackp...@gmail.com) wrote:

> Ok. Failed to discover that option. Trying it now.
> 
> with url = "[http://localhost](http://localhost)" or "/localhost" I see  
> UnresolvedAddressException  
> with url = "localhost" or "10.1.10.180" (which is published by ec)  
> and port = 9200
> 
> at: client.addTransportAddress(new InetSocketTransportAddress(url, port));
> 
> the system hangs and goes nowhere.
> 
> One other point: using the mobz-elasticsearch-head javascript browser,  
> the index is visible and performing just fine.
> 
> Not sure why it's hanging.  
> One other modest question while we are here: do I need to do  
> URLencoding when going through this transport mechanism?
> 
> Thanks  
> Jack
> 
> On Thu, Jun 9, 2011 at 1:47 PM, Karussell [tableyourt...@googlemail.com](mailto:tableyourt...@googlemail.com) wrote:
> 
> > Hi Jack,
> 
> > I meant you could use the 'real' Java API without any raw stuff or  
> > Apache libs:
> 
> > Settings s = ImmutableSettings.settingsBuilder().put("cluster.name",  
> > cluster).build();  
> > TransportClient tmp = new TransportClient(s);  
> > tmp.addTransportAddress(new InetSocketTransportAddress(url, port));
> 
> > // with the next line you need to create the mapping structure  
> > XContentBuilder b =  
> > JsonXContent.unCachedContentBuilder().field("someField", "value");  
> > // ... and eventually call b.startObject before + b.endObject after  
> > this
> 
> > client.admin().indices().preparePutMapping("indexName").setSource(b);

---

<div class="post-metadata">

**Author:** ![Jack\_Park](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jack_park/32/30787_2.png) [@Jack\_Park](https://discuss.elastic.co/u/Jack_Park)\
**Post date:** [June 10, 2011, 12:20am UTC](https://discuss.elastic.co/t/invalidindexnameexception-must-not-contain-whitespace/4590/7 "2011-06-10T00:20:38Z")

</div>

For completeness, the system is now running, thank you very much.

To pull that off, I found it useful to use the web interface after  
booting an empty ES database and create the indexes I would use. I  
then did not bother injecting schemas but, instead, just indexed  
documents as they came in. According to the web interface, all  
documents, types, and fields got indexed properly.

Thanks  
Jack

On Thu, Jun 9, 2011 at 3:13 PM, Karussell [tableyourtime@googlemail.com](mailto:tableyourtime@googlemail.com) wrote:

> > UnresolvedAddressException
> 
> use 9300
> 
> if that does not help try using 127.0.0.1
> 
> Have a look:
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/java-api/)
> 
> > mobz-elasticsearch-head
> 
> ah, yes, that was a good idea 🙂
> 
> > do I need to do URLencoding when going through this transport mechanism?
> 
> no, as ES uses json (or a special version of it called smile, thats  
> why you need the different port 9300 for the java client)
> 
> On Jun 9, 11:53 pm, Jack Park [jackp...@gmail.com](mailto:jackp...@gmail.com) wrote:
> 
> > Ok. Failed to discover that option. Trying it now.
> > 
> > with url = "[http://localhost](http://localhost)" or "/localhost" I see  
> > UnresolvedAddressException  
> > with url = "localhost" or "10.1.10.180" (which is published by ec)  
> > and port = 9200
> > 
> > at: client.addTransportAddress(new InetSocketTransportAddress(url, port));
> > 
> > the system hangs and goes nowhere.
> > 
> > One other point: using the mobz-elasticsearch-head javascript browser,  
> > the index is visible and performing just fine.
> > 
> > Not sure why it's hanging.  
> > One other modest question while we are here: do I need to do  
> > URLencoding when going through this transport mechanism?
> > 
> > Thanks  
> > Jack
> > 
> > On Thu, Jun 9, 2011 at 1:47 PM, Karussell [tableyourt...@googlemail.com](mailto:tableyourt...@googlemail.com) wrote:
> > 
> > > Hi Jack,
> > 
> > > I meant you could use the 'real' Java API without any raw stuff or  
> > > Apache libs:
> > 
> > > Settings s = ImmutableSettings.settingsBuilder().put("cluster.name",  
> > > cluster).build();  
> > > TransportClient tmp = new TransportClient(s);  
> > > tmp.addTransportAddress(new InetSocketTransportAddress(url, port));
> > 
> > > // with the next line you need to create the mapping structure  
> > > XContentBuilder b =  
> > > JsonXContent.unCachedContentBuilder().field("someField", "value");  
> > > // ... and eventually call b.startObject before + b.endObject after  
> > > this
> > 
> > > client.admin().indices().preparePutMapping("indexName").setSource(b);

---

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [June 10, 2011, 8:31am UTC](https://discuss.elastic.co/t/invalidindexnameexception-must-not-contain-whitespace/4590/8 "2011-06-10T08:31:33Z")

</div>

On Jun 10, 2:20 am, Jack Park [jackp...@gmail.com](mailto:jackp...@gmail.com) wrote:

> For completeness, the system is now running, thank you very much.

Good. Glad to helped a bit 🙂

> To pull that off, I found it useful to use the web interface after  
> booting an empty ES database and create the indexes I would use. I  
> then did not bother injecting schemas but, instead, just indexed  
> documents as they came in. According to the web interface, all  
> documents, types, and fields got indexed properly.

I'm storing the mapping under e.g. elasticsearch/config/mappings/  
\_default/tweet.json this way I can add not\_analyzed to the fields and  
exclude the \_all field which is enabled by default:

{  
"tweet" : {  
"\_all" : {"enabled" : false},  
"properties" : {  
"text" : { "type" : "string", "analyzer" :  
"index\_analyzer"},  
"inreply\_l" : { "type" : "long", "null\_value" : -1,  
"index" : "not\_analyzed"},  
"user" : { "type" : "string", "index" : "not\_analyzed"},  
"geo" : { "type" : "geo\_point" },  
...  
}  
}  
}

---

<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, 4:03am UTC](https://discuss.elastic.co/t/invalidindexnameexception-must-not-contain-whitespace/4590/9 "2017-07-06T04:03:56Z")

</div>


