elastic_tutorial/The Elasticsearch Documentation/2_start/1_create_index.es
2025-04-09 09:37:23 +03:30

22 lines
667 B
JavaScript

PUT /firstindex
{
"mappings": {
"properties": {
"username": {
"type": "text"
},
"age": {
"type": "integer"
}
}
}
}
// Creating an index with username field and age field
// DataTypes in elasticsearch:
// text: متن
// keyword: متنی که یک کلمه خاص است، مانند آی دی با حروف یا پسورد
// integer: اعداد عادی و اعشاری
// date: زمان(فرمت های مختلف مثلا ISO8601)
// boolean: True and False
// object: ذخیره یک آبجکت با زبان های شی گرا