JSON conversion to properties


(James Cook-3) #1

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' -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?


(James Cook-3) #2

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

curl -XGET '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' -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?


(system) #3