Elasticsearch : Root mapping definition has unsupported parameters index : not_analyzed

后端 未结 5 1201
一生所求
一生所求 2020-12-23 11:17

Hi all I am trying to create schema Test.

PUT /test
{
    \"mappings\": {
        \"field1\": {
            \"type\": \"integer\"
        },
        \"field         


        
5条回答
  •  清酒与你
    2020-12-23 11:42

    PUT /testIndex
    {
        "mappings": {
            "properties": {     <--ADD THIS
                "field1": {
                    "type": "integer"
                },
                "field2": {  
                    "type": "integer"
                },
                "field3": {
                    "type": "string",
                    "index": "not_analyzed"
                },
                "field4": {
                    "type": "string",
                    "analyzer": "autocomplete",
                    "search_analyzer": "standard"
                }
            }
        },
        "settings": {
            bla
            bla
            bla
        }
    }
    

    Here's a similar command I know works:

    curl -v -H "Content-Type: application/json" -H "Authorization: Basic cGC3COJ1c2Vy925hZGFJbXBvcnABCnRl" -X PUT -d '{"mappings":{"properties":{"city":{"type": "text"}}}}' https://35.80.2.21/manzanaIndex
    

    The breakdown for the above curl command is:

    PUT /manzanaIndex
    {
        "mappings":{
            "properties":{
                    "city":{
                        "type": "text"
                    }
            }
        }
    }
    

提交回复
热议问题