I created a type 'post'
curl -XPUT localhost:9200/facebook/post/_mapping -d '
{
- "post": {*
-
"_id": {*
-
"path": "post_id"*
-
},*
-
"_ttl": {*
-
"enabled": true*
-
},*
-
"_source": {*
-
"enabled": false*
-
},*
-
"properties": {*
-
"post_id": {*
-
"type": "long"*
-
},*
-
"user": {*
-
"type": "string",*
-
"store": true*
-
},*
-
"message": {*
-
"type": "string",*
-
"store": true*
-
}*
-
}*
- }*
}'
Then I add a document curl -XPOST -s localhost:9200/facebook/post -d
'{"post_id":1,"user":"kimchy","message":"Hello
World","field1":"foo","field2":"bar"}'
It successfully adds the document.
Is this the default behaviour? Shouldn't it throw an exception saying that
the new properties are not supported for this type*
*
*
*
Then I do a simple search: curl -XPOST -s
localhost:9200/facebook/post/_search?q=foo | jq '.'
I get the result:
{
- "hits": {*
- "hits": [*
-
{*
-
"_score": 0.11506981,*
-
"_id": "1",*
-
"_type": "post",*
-
"_index": "facebook"*
-
}*
- ],*
- "max_score": 0.11506981,*
- "total": 1*
- },*
- "_shards": {*
- "failed": 0,*
- "successful": 3,*
- "total": 3*
- },*
- "timed_out": false,*
- "took": 4*
}
Is it possible to make the default value of index for all fields "no"
rather than 'analyzed' since fields are added automatically?
--
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.
For more options, visit https://groups.google.com/groups/opt_out.