Simple question about mapping query

Hi,

I need to know what does "lib_entite" (line 3) mean in this query please ?

curl -XPUT 'localhost:9200/_mapping/region?ignore_conflicts=true' -d '{
	  "properties": {
	    "lib_entite": { 
	      "type":           "string",
	      "analyzer":       "standard",
	      "fields": {
		"folded": { 
		  "type":       "string",
		  "analyzer":   "folding"
		}
	      }
	    }
	  }
	}'

Thank you !

Hmm, I think this API call is not formatted correctly. There are two options when adding the mapping:

Specify just the index in the URI, and include mapping in the body. E.g stealing an example from the docs:

curl -XPUT localhost:9200/twitter -d '    // <--- 'twitter' index
{
  "mappings": {            <--- 'mappings' reserved keyword
    "tweet": {             <--- 'tweet' type
      "properties": {      <--- 'properties' reserved keyword
        "message": {       <--- 'message' is the name of the field in your doc
          "type": "string"
        }
      }
    }
  }
}'

The alternative structure is to define the index and type in the URI, which lets you drop the 'mapping' and type name from the body:

curl -XPUT localhost:9200/twitter/_mapping/tweet/    <-- 'twitter' index, 'tweet' type
{
  "properties": {        <--- 'properties' reserved keyword
    "message": {         <--- 'message' is the name of the field in your doc
      "type": "string"
    }
  }
}

So, getting back to your question, it looks like your request is somewhere in the middle. You've specified the index but not type in the URI, but have not specified 'mappings' or the type in the body.

To answer your actual question, the lib_entite string refers to a field name which is being mapped :slight_smile:

1 Like

I spicified also the type in URL :slight_smile: is named region

localhost:9200/_mapping/region

Thank you very much for your answer ! I see now :wink: