I'm using elasticsearch-5.4.1 and am unable to create a mapping for a custom type on my index. Basically I'm trying to create a document of a login to a system.
I created an index via curl curl -X PUT http://localhost:9200/userlogin
I can see it with curl -XGET 'localhost:9200/_cat/indices?v&pretty'
To create the mapping (which fails):
curl -XPUT 'http://localhost:9200/userlogin/_mapping/login' -H 'Content-Type: application/json' -d '
{"properties": {
"username": {"type": "text"},
"firstname": {"type": "text"},
"lastname": {"type": "text"},
"queue": {"type": "text"},
"timestamp": {"type": "date"}
}}'
Error:
{"error":"MapperParsingException[No handler for type [text] declared on field [username]]","status":400}[root@gv-karaf-dev-1 elasticsearch-5.4.1]
According to https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html this is exactly how one is supposed to do this from what I understand. How is test not a thing I can use? Is there an alternative?
possible duplicate of No handler for type [text] declared on field [title] (python elasticsearch but there was no answer there