# JSON conversion to properties

**URL:** <https://discuss.elastic.co/t/json-conversion-to-properties/8008>\
**Category:** Elasticsearch\
**Created:** [June 7, 2012, 1:56pm UTC](https://discuss.elastic.co/t/json-conversion-to-properties/8008 "2012-06-07T13:56:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Cook\_3](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@James\_Cook\_3](https://discuss.elastic.co/u/James_Cook_3)\
**Post date:** [June 7, 2012, 1:56pm UTC](https://discuss.elastic.co/t/json-conversion-to-properties/8008/1 "2012-06-07T13:56:37Z")

</div>

Clinton was kind enough to provide me with a mapping in JSON that I have to  
convert to a properties file format. Here is his example:

curl -XPUT '[http://127.0.0.1:9200/test/?pretty=1](http://127.0.0.1:9200/test/?pretty=1)' -d '  
{  
"mappings" : {  
"test" : {  
"properties" : {  
"lang" : {  
"fields" : {  
"base" : {  
"omit\_term\_freq\_and\_positions" : 1,  
"omit\_norms" : 1,  
"type" : "string",  
"analyzer" : "base\_lang"  
},  
"lang" : {  
"index" : "not\_analyzed",  
"omit\_term\_freq\_and\_positions" : 1,  
"omit\_norms" : 1,  
"type" : "string"  
}  
},  
"type" : "multi\_field"  
}  
}  
}  
},  
"settings" : {  
"analysis" : {  
"analyzer" : {  
"base\_lang" : {  
"tokenizer" : "base\_lang"  
}  
},  
"tokenizer" : {  
"base\_lang" : {  
"group" : 0,  
"pattern" : "^(\w\w)",  
"type" : "pattern"  
}  
}  
}  
}  
}  
'

I have tries converting this to properties using:

index.analysis.analyzer.base\_lang.type=pattern  
index.analysis.analyzer.base\_lang.pattern=^(\w\w)  
index.analysis.analyzer.base\_lang.group=0

But this does not result in the appropriate results. Can anyone point me in  
the right direction?

---

<div class="post-metadata">

**Author:** ![James\_Cook\_3](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@James\_Cook\_3](https://discuss.elastic.co/u/James_Cook_3)\
**Post date:** [June 7, 2012, 2:06pm UTC](https://discuss.elastic.co/t/json-conversion-to-properties/8008/2 "2012-06-07T14:06:18Z")

</div>

Ahh, all I had to do is use the \_settings URL

curl -XGET '[http://localhost:9200/test/\_settings?pretty=true](http://localhost:9200/test/_settings?pretty=true)'  
{  
"test" : {  
"settings" : {  
"index.analysis.analyzer.base\_lang.tokenizer" : "base\_lang",  
"index.analysis.tokenizer.base\_lang.type" : "pattern",  
"index.analysis.tokenizer.base\_lang.pattern" : "^(\w\w)",  
"index.analysis.tokenizer.base\_lang.group" : "0",  
"index.number\_of\_shards" : "5",  
"index.number\_of\_replicas" : "1",  
"index.version.created" : "190399"  
}  
}  
}

On Thursday, June 7, 2012 9:56:37 AM UTC-4, James Cook wrote:

> Clinton was kind enough to provide me with a mapping in JSON that I have  
> to convert to a properties file format. Here is his example:
> 
> curl -XPUT '[http://127.0.0.1:9200/test/?pretty=1](http://127.0.0.1:9200/test/?pretty=1)' -d '  
> {  
> "mappings" : {  
> "test" : {  
> "properties" : {  
> "lang" : {  
> "fields" : {  
> "base" : {  
> "omit\_term\_freq\_and\_positions" : 1,  
> "omit\_norms" : 1,  
> "type" : "string",  
> "analyzer" : "base\_lang"  
> },  
> "lang" : {  
> "index" : "not\_analyzed",  
> "omit\_term\_freq\_and\_positions" : 1,  
> "omit\_norms" : 1,  
> "type" : "string"  
> }  
> },  
> "type" : "multi\_field"  
> }  
> }  
> }  
> },  
> "settings" : {  
> "analysis" : {  
> "analyzer" : {  
> "base\_lang" : {  
> "tokenizer" : "base\_lang"  
> }  
> },  
> "tokenizer" : {  
> "base\_lang" : {  
> "group" : 0,  
> "pattern" : "^(\w\w)",  
> "type" : "pattern"  
> }  
> }  
> }  
> }  
> }  
> '
> 
> I have tries converting this to properties using:
> 
> index.analysis.analyzer.base\_lang.type=pattern  
> index.analysis.analyzer.base\_lang.pattern=^(\w\w)  
> index.analysis.analyzer.base\_lang.group=0
> 
> But this does not result in the appropriate results. Can anyone point me  
> in the right direction?

---

<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, 3:25am UTC](https://discuss.elastic.co/t/json-conversion-to-properties/8008/3 "2017-07-06T03:25:21Z")

</div>


