Querying "Hash" Values Stored under String Mapping

Hiya

"test" : {
"properties" : {
"foo" : {
"type" : "string"
}
}
}

And if you index an unescaped JSON, like this:

curl -XPUT localhost:9200/test/test/111 -d '{"foo":{"bar":"baz"}}'

You should end up only with the words, like this:

"_source" : {"foo":"bar baz"}

This wouldn't work. ES receives field 'foo' which is of type 'object',
compares it to the mapping and finds that field 'foo' should be of type
'string', so it ignores it.

If you want the bar/baz json to be indexed as text, then you need to
pass it as text:

curl -XPOST 'http://127.0.0.1:9200/test/test?pretty=1' -d '
{
"foo" : "{"bar":"baz"}"
}
'

clint

--