elastic_tutorial/The Elasticsearch Documentation/8_analyzer/3_test.es
2025-04-09 09:37:23 +03:30

601 lines
10 KiB
Erlang
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// این یک مثال واقعی از ساخت ایندکس است
// بخشی از آن با مرحله قبل یکی است
{
"mappings": {
"properties": {
"id": {
"type": "keyword"
},
"person_code": {
"type": "keyword"
},
"research_code": {
"type": "keyword"
},
"meet_code": {
"type": "keyword"
},
"Allwords": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"author": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"branch": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"title": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"meet_no": {
"type": "integer"
},
"subject": {
"properties": {
"id": {
"type": "integer"
},
"title": {
"type": "text",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"subtitle": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"tags": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"keywords": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"verb": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"format": {
"type": "text",
"fielddata": true,
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"begin_year": {
"type": "integer",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 20
}
}
},
"begin_date": {
"type": "keyword"
},
"end_date": {
"type": "keyword"
},
"amplify": {
"type": "text"
},
"ralation": {
"type": "keyword"
},
"city": {
"type": "keyword"
},
"place": {
"type": "keyword"
},
"address": {
"type": "text"
},
"films": {
"type": "integer"
},
"voices": {
"type": "integer"
},
"photos": {
"type": "integer"
},
"audience": {
"type": "text",
"fielddata": true
},
"attendees": {
"type": "text"
},
"report_tmp": {
"properties": {
"address": {"type": "integer"},
"mindex": {"type": "integer"},
"mintro": {"type": "integer"},
"sanad_data1": {"type": "integer"},
"sanad_data2": {"type": "integer"}
}
},
"mindex": {
"type": "text",
"fields": {
"fa": {
"type": "text",
"analyzer": "normal_analyzer_persian",
"search_analyzer": "normal_analyzer_persian",
"search_quote_analyzer": "phrase_analyzer_persian"
},
"ar": {
"type": "text",
"analyzer": "normal_analyzer_arabic",
"search_analyzer": "normal_analyzer_arabic",
"search_quote_analyzer": "phrase_analyzer_arabic"
},
"ph": {
"type": "text",
"analyzer": "phrase_analyzer_persian",
"search_analyzer": "phrase_analyzer_persian",
"search_quote_analyzer": "phrase_analyzer_persian"
}
}
},
"mintro": {
"type": "text",
"fields": {
"fa": {
"type": "text",
"analyzer": "normal_analyzer_persian",
"search_analyzer": "normal_analyzer_persian",
"search_quote_analyzer": "phrase_analyzer_persian"
},
"ar": {
"type": "text",
"analyzer": "normal_analyzer_arabic",
"search_analyzer": "normal_analyzer_arabic",
"search_quote_analyzer": "phrase_analyzer_arabic"
},
"ph": {
"type": "text",
"analyzer": "phrase_analyzer_persian",
"search_analyzer": "phrase_analyzer_persian",
"search_quote_analyzer": "phrase_analyzer_persian"
}
}
},
"sanad_data1": {
"type": "text",
"fields": {
"fa": {
"type": "text",
"analyzer": "normal_analyzer_persian",
"search_analyzer": "normal_analyzer_persian",
"search_quote_analyzer": "phrase_analyzer_persian"
},
"ar": {
"type": "text",
"analyzer": "normal_analyzer_arabic",
"search_analyzer": "normal_analyzer_arabic",
"search_quote_analyzer": "phrase_analyzer_arabic"
},
"ph": {
"type": "text",
"analyzer": "phrase_analyzer_persian",
"search_analyzer": "phrase_analyzer_persian",
"search_quote_analyzer": "phrase_analyzer_persian"
}
}
},
"sanad_data2": {
"type": "text",
"fields": {
"fa": {
"type": "text",
"analyzer": "normal_analyzer_persian",
"search_analyzer": "normal_analyzer_persian",
"search_quote_analyzer": "phrase_analyzer_persian"
},
"ar": {
"type": "text",
"analyzer": "normal_analyzer_arabic",
"search_analyzer": "normal_analyzer_arabic",
"search_quote_analyzer": "phrase_analyzer_arabic"
},
"ph": {
"type": "text",
"analyzer": "phrase_analyzer_persian",
"search_analyzer": "phrase_analyzer_persian",
"search_quote_analyzer": "phrase_analyzer_persian"
}
}
},
"sanad_type1": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 20
}
}
},
"sanad_type2": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 20
}
}
},
"next_page": {
"type": "integer"
},
"completion" : {
"type" : "completion",
"analyzer" : "simple",
"preserve_separators" : true,
"preserve_position_increments" : true,
"max_input_length" : 50
}
}
},
"settings": {
"index": {
"analysis": {
"analyzer": {
"phrase_analyzer_persian": {
"type": "custom",
"tokenizer": "standard",
"char_filter": [
"persian_char_filter"
],
"filter": []
},
"phrase_analyzer_arabic": {
"type": "custom",
"tokenizer": "standard",
"char_filter": [
"arabic_char_filter"
],
"filter": []
},
"normal_analyzer_persian": {
"type": "custom",
"tokenizer": "standard",
"char_filter": [
"persian_char_filter"
],
"filter": [
"persian_synonym",
"persian_stop"
]
},
"normal_analyzer_arabic": {
"type": "custom",
"tokenizer": "standard",
"char_filter": [
"persian_char_filter"
],
"filter": [
"arabic_synonym",
"arabic_stop"
]
}
},
"filter": {
"persian_synonym": {
"type": "synonym",
"lenient": true,
"_comment": "نعيم, حميد => نعيم",
"synonyms": [
"آب زي, آبزي => آب زي",
"آرامش بخش, آرامش‌بخش => آرامش بخش",
"شوقي, شوق => شوق",
"مقصودشان, مقصود => مقصود",
"عفاهما, عفا => عفا",
"عفاتك, عفا => عفا",
"عقالاته, عقال => عقال"
]
},
"arabic_synonym": {
"type": "synonym",
"lenient": true,
"_comment": "نعيم, حميد => نعيم",
"synonyms": [
"آب زي, آبزي => آب زي",
"آرامش بخش, آرامش‌بخش => آرامش بخش",
"شوقي, شوق => شوق",
"مقصودشان, مقصود => مقصود",
"عفاهما, عفا => عفا",
"عفاتك, عفا => عفا",
"عقالاته, عقال => عقال"
]
},
"persian_stop": {
"type": "stop",
"stopwords": [
"یا",
"را",
"این",
"با",
"آن",
"و",
"در",
"به",
"که",
"از",
"طی",
"پس",
"چه",
"اگر",
"نه",
"آنها",
"هر",
"او",
"ما",
"من",
"تا",
"نیز",
"اما",
"یک",
"بر",
"هم",
"برای",
"کن",
"کرد",
"کردن",
"باش",
"بود",
"بودن",
"شو",
"شد",
"شدن",
"‏دار",
"داشت",
"داشتن",
"‏خواه",
"خواست",
"خواستن",
"‏گوی",
"گفت",
"گفتن",
"‏گیر",
"گرفت",
"گرفتن",
"‏آی",
"آمد",
"آمدن",
"‏توان",
"توانستن",
"‏یاب",
"یافتن",
"‏آور",
"آورد",
"آوردن",
"1",
"2",
"3",
"ص",
"4",
"و",
"5",
"ج",
"6",
"a",
"top",
"href",
"pageno"
],
"char_filter": [
"my_char_filter"
]
},
"arabic_stop": {
"type": "stop",
"stopwords": [
"1",
"2",
"3",
"ص",
"4",
"و",
"5",
"ج",
"6",
"a",
"top",
"href",
"pageno",
"الصفحة_0",
"7",
"١",
"من",
"في",
"أن",
"ما",
"لا",
"إلى",
"به",
"أو",
"قد",
"يا",
"مع",
"بها",
"لو",
"أم",
"عليه",
"له",
"ذلك",
"إذا",
"إن",
"إلا",
"أنه",
"فيه",
"حتى",
"هو",
"منه",
"كل",
"بعد",
"أي",
"غير",
"كما",
"بين",
"إليه",
"فيها",
"عند",
"ثنا",
"لما",
"قبل",
"التي",
"ليس",
"كانت",
"أيضا",
"لهم",
"لها",
"لي",
"إنما",
"فيما",
"عز",
"عليهم",
"يكن",
"عليها",
"الذين",
"بني",
"مما",
"لك",
"إذ",
"هي",
"بل",
"أما",
"نا",
"حين",
"ألا",
"معه",
"قالت",
"إني",
"أنت",
"عنها",
"هل",
"لنا",
"أنها",
"ان"
],
"char_filter": [
"my_char_filter"
]
},
"arabic_stemmer": {
"type": "stemmer",
"name": "arabic"
}
},
"char_filter": {
"persian_char_filter": {
"type": "mapping",
"mappings": [
"٠ => 0",
"١ => 1",
"٢ => 2",
"٣ => 3",
"٤ => 4",
"٥ => 5",
"٦ => 6",
"٧ => 7",
"٨ => 8",
"٩ => 9",
"ک => ك",
"ی => ي",
"ة => ه",
"إ => ا",
"أ => ا",
"آ => ا",
"ء => ا",
"َ => ",
"ُ => ",
"ِ => ",
"ّ => ",
"ً => ",
"ٌ => ",
"ٍ => ",
"ْ => "
]
},
"arabic_char_filter": {
"type": "mapping",
"mappings": [
"٠ => 0",
"١ => 1",
"٢ => 2",
"٣ => 3",
"٤ => 4",
"٥ => 5",
"٦ => 6",
"٧ => 7",
"٨ => 8",
"٩ => 9",
"ک => ك",
"ی => ي"
]
}
}
},
"number_of_shards": "1",
"number_of_replicas": "0"
}
}
}