XGET to _mapping does not match the mapping I used to create the index, is this normal?


(Enno Shioji) #1

Hi, I created my index using this mapping JSON:

{
"myidx": {
"index.refresh_interval":"5m",
"mappings": {
"dynamic": "strict",
"message": {
"_ttl": {
"enabled": true
},
"properties": {
"my_nested_thing": {
"type": "nested",
"properties": {
"some_id": {
"type": "string", "index": "not_analyzed"
},
"count": {
"type": "long"
},
}
}
}
}
}
}
}

If I do a GET to _mapping after indexing some documents, it will
essentially return:

    {
        "message": {
            "properties": {
                "my_nested_thing": {
                    "properties": {
                        "some_id": {
                            "type": "string", "index": "not_analyzed"
                        },
                        "count": {
                            "type": "long"
                        },
                    }
                }
            }
        }
    }

I.e. "_ttl": enabled=true and the "type": "nested" is not present from the
mapping. I also noticed that it allows auto update to the mapping despite
the "dynamic": "strict" instruction.

Does this mean these instructions are somehow not being reflected? If so,
what am I doing wrong?

I'm using version 1.2.1

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/b57199bf-c01f-4b86-9d8d-a4acfb06618c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Jun Ohtani) #2

Hi,

How do you use API to create index?

I think “dynamic” property is wrong place.

I try to create index to use the following JSON and index;

curl -XPOST localhost:9200/myidx -d '
{
"settings": {
"index.refresh_interval": "5m"
},
"mappings": {
"message": {
"dynamic": "strict",
"_ttl": {
"enabled": true
},
"properties": {
"my_nested_thing": {
"type": "nested",
"properties": {
"some_id": {
"type": "string",
"index": "not_analyzed"
},
"count": {
"type": "long"
}
}
}
}
}
}
}'

curl -XGET localhost:9200/myidx/_mapping?pretty

{
"myidx" : {
"mappings" : {
"message" : {
"dynamic" : "strict",
"_ttl" : {
"enabled" : true
},
"properties" : {
"my_nested_thing" : {
"type" : "nested",
"properties" : {
"count" : {
"type" : "long"
},
"some_id" : {
"type" : "string",
"index" : "not_analyzed"
}
}
}
}
}
}
}
}

Does it make sense?


Jun Ohtani
johtani@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani

2014/06/06 22:31、Enno Shioji eshioji@gmail.com のメール:

Hi, I created my index using this mapping JSON:

{
"myidx": {
"index.refresh_interval":"5m",
"mappings": {
"dynamic": "strict",
"message": {
"_ttl": {
"enabled": true
},
"properties": {
"my_nested_thing": {
"type": "nested",
"properties": {
"some_id": {
"type": "string", "index": "not_analyzed"
},
"count": {
"type": "long"
},
}
}
}
}
}
}
}

If I do a GET to _mapping after indexing some documents, it will essentially return:

    {
        "message": {
            "properties": {
                "my_nested_thing": {
                    "properties": {
                        "some_id": {
                            "type": "string", "index": "not_analyzed"
                        },
                        "count": {
                            "type": "long"
                        },
                    }
                }
            }
        }
    }

I.e. "_ttl": enabled=true and the "type": "nested" is not present from the mapping. I also noticed that it allows auto update to the mapping despite the "dynamic": "strict" instruction.

Does this mean these instructions are somehow not being reflected? If so, what am I doing wrong?

I'm using version 1.2.1

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/b57199bf-c01f-4b86-9d8d-a4acfb06618c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Enno Shioji) #3

Hi Jun,

Ah, I must be doing something wrong then. I'll correct the JSON and test
again.

Btw わざわざテストしていただきありがとうございます!

On Friday, 6 June 2014 15:29:37 UTC+1, Jun Ohtani wrote:

Hi,

How do you use API to create index?

I think “dynamic” property is wrong place.

I try to create index to use the following JSON and index;

curl -XPOST localhost:9200/myidx -d '
{
"settings": {
"index.refresh_interval": "5m"
},
"mappings": {
"message": {
"dynamic": "strict",
"_ttl": {
"enabled": true
},
"properties": {
"my_nested_thing": {
"type": "nested",
"properties": {
"some_id": {
"type": "string",
"index": "not_analyzed"
},
"count": {
"type": "long"
}
}
}
}
}
}
}'

curl -XGET localhost:9200/myidx/_mapping?pretty

{
"myidx" : {
"mappings" : {
"message" : {
"dynamic" : "strict",
"_ttl" : {
"enabled" : true
},
"properties" : {
"my_nested_thing" : {
"type" : "nested",
"properties" : {
"count" : {
"type" : "long"
},
"some_id" : {
"type" : "string",
"index" : "not_analyzed"
}
}
}
}
}
}
}
}

Does it make sense?


Jun Ohtani
joh...@gmail.com <javascript:>
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani

2014/06/06 22:31、Enno Shioji <esh...@gmail.com <javascript:>> のメール:

Hi, I created my index using this mapping JSON:

{
"myidx": {
"index.refresh_interval":"5m",
"mappings": {
"dynamic": "strict",
"message": {
"_ttl": {
"enabled": true
},
"properties": {
"my_nested_thing": {
"type": "nested",
"properties": {
"some_id": {
"type": "string", "index":
"not_analyzed"
},
"count": {
"type": "long"
},
}
}
}
}
}
}
}

If I do a GET to _mapping after indexing some documents, it will
essentially return:

    { 
        "message": { 
            "properties": { 
                "my_nested_thing": { 
                    "properties": { 
                        "some_id": { 
                            "type": "string", "index": 

"not_analyzed"

                        }, 
                        "count": { 
                            "type": "long" 
                        }, 
                    } 
                } 
            } 
        } 
    } 

I.e. "_ttl": enabled=true and the "type": "nested" is not present from
the mapping. I also noticed that it allows auto update to the mapping
despite the "dynamic": "strict" instruction.

Does this mean these instructions are somehow not being reflected? If
so, what am I doing wrong?

I'm using version 1.2.1

--
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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/b57199bf-c01f-4b86-9d8d-a4acfb06618c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/7aeb3e33-4ad0-41d5-a27f-4e21b326e78d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Jun Ohtani) #4

Hi,

You’re welcome.

Btw Twitterとかで聞いてもらっても答えますので、お気軽に。もちろん、MLのほうが皆さんに見えるのでいいのですが。


Jun Ohtani
johtani@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani

2014/06/07 0:17、Enno Shioji eshioji@gmail.com のメール:

Hi Jun,

Ah, I must be doing something wrong then. I'll correct the JSON and test again.

Btw わざわざテストしていただきありがとうございます!

On Friday, 6 June 2014 15:29:37 UTC+1, Jun Ohtani wrote:
Hi,

How do you use API to create index?

I think “dynamic” property is wrong place.

I try to create index to use the following JSON and index;

curl -XPOST localhost:9200/myidx -d '
{
"settings": {
"index.refresh_interval": "5m"
},
"mappings": {
"message": {
"dynamic": "strict",
"_ttl": {
"enabled": true
},
"properties": {
"my_nested_thing": {
"type": "nested",
"properties": {
"some_id": {
"type": "string",
"index": "not_analyzed"
},
"count": {
"type": "long"
}
}
}
}
}
}
}'

curl -XGET localhost:9200/myidx/_mapping?pretty

{
"myidx" : {
"mappings" : {
"message" : {
"dynamic" : "strict",
"_ttl" : {
"enabled" : true
},
"properties" : {
"my_nested_thing" : {
"type" : "nested",
"properties" : {
"count" : {
"type" : "long"
},
"some_id" : {
"type" : "string",
"index" : "not_analyzed"
}
}
}
}
}
}
}
}

Does it make sense?


Jun Ohtani
joh...@gmail.com
blog : http://blog.johtani.info
twitter : http://twitter.com/johtani

2014/06/06 22:31、Enno Shioji esh...@gmail.com のメール:

Hi, I created my index using this mapping JSON:

{
"myidx": {
"index.refresh_interval":"5m",
"mappings": {
"dynamic": "strict",
"message": {
"_ttl": {
"enabled": true
},
"properties": {
"my_nested_thing": {
"type": "nested",
"properties": {
"some_id": {
"type": "string", "index": "not_analyzed"
},
"count": {
"type": "long"
},
}
}
}
}
}
}
}

If I do a GET to _mapping after indexing some documents, it will essentially return:

    { 
        "message": { 
            "properties": { 
                "my_nested_thing": { 
                    "properties": { 
                        "some_id": { 
                            "type": "string", "index": "not_analyzed" 
                        }, 
                        "count": { 
                            "type": "long" 
                        }, 
                    } 
                } 
            } 
        } 
    } 

I.e. "_ttl": enabled=true and the "type": "nested" is not present from the mapping. I also noticed that it allows auto update to the mapping despite the "dynamic": "strict" instruction.

Does this mean these instructions are somehow not being reflected? If so, what am I doing wrong?

I'm using version 1.2.1

--
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 elasticsearc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/b57199bf-c01f-4b86-9d8d-a4acfb06618c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/7aeb3e33-4ad0-41d5-a27f-4e21b326e78d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #5