輿情繫統mapping

so_easy發表於2020-11-11
PUT toutiao_sentiment
{
  "mappings": {
    "doc": {
      "dynamic": true,
      "properties": {
        "id": {
          "store": false,
          "type": "long",
          "index": false
        },
        "item_id": {
          "store": false,
          "type": "long",
          "index": false
        },
        "title": {
          "store": false,
          "type": "text",
          "index": false
        },
        "abstract": {
          "store": false,
          "type": "text",
          "index": true
        },
        "content": {
          "store": false,
          "analyzer": "cnFilter",
          "search_analyzer": "ik_smart",
          "fields": {
            "keyword": {
              "type": "text",
              "index": true,
              "analyzer":"keep_words",
              "search_analyzer":"keep_words",
              "fielddata": true
            }
          },
          "type": "text",
          "index": true,
          "fielddata": true
        },
        "url": {
          "store": false,
          "type": "keyword",
          "index": false
        },
        "ctime": {
          "store": false,
          "type": "date",
          "index": true,
          "format": "yyyy-MM-dd HH:mm:ss"
        },
        "create_time": {
          "store": false,
          "type": "date",
          "index": false,
          "format": "yyyy-MM-dd HH:mm:ss"
        },
        "source": {
          "store": false,
          "type": "keyword",
          "index": true
        },
        "comment_count": {
          "store": false,
          "type": "integer",
          "index": false
        },
        "digg_count": {
          "store": false,
          "type": "integer",
          "index": false
        },
        "play_count": {
          "store": false,
          "type": "integer",
          "index": false
        },
        "read_count": {
          "store": false,
          "type": "integer",
          "index": false
        },
        "user_id": {
          "store": false,
          "type": "long",
          "index": false
        },
        "kind": {
          "store": false,
          "type": "keyword",
          "index": true
        },
        "kw": {
          "store": false,
          "type": "keyword",
          "index": true
        },
        "index_kw": {
          "store": false,
          "type": "keyword",
          "index": false
        },
        "update_time": {
          "store": false,
          "type": "date",
          "index": false
        }
      }
    }
  },
  "settings": {
    "index": {
      "analysis": {
        "analyzer": {
          "cnFilter": {
            "tokenizer": "ik_max_word",
            "char_filter": [
              "html_strip",
              "my_mapping_char"
            ],
            "filter": [
              "length_2_to_10_char"
              ]
          },
          "keep_words": {
            "tokenizer": "ik_max_word",
            "char_filter": [
              "html_strip",
              "my_mapping_char"
            ],
            "filter": [
              "length_2_to_10_char",
              "keep_word_file"
              ]
          },
          "ik_syno_max_word": {
            "tokenizer": "ik_max_word",
            "filter": "my_synonym_filter"
          },
          "ik_syno_smart": {
            "tokenizer": "ik_smart",
            "filter": "my_synonym_filter"
          },
          "full_pinyin_analyzer": {
            "filter": [
              "lowercase",
              "full_pinyin"
            ],
            "tokenizer": "standard"
          },
          "prefix_pinyin_analyzer": {
            "filter": [
              "lowercase",
              "prefix_pinyin"
            ],
            "tokenizer": "standard"
          }
        },
        "char_filter": {
          "my_mapping_char": {
            "type": "mapping",
            "mappings_path": "char_mapping.dic"
          }
        },
        "filter": {
          "keep_word_file": {
            "type": "keep",
            "keep_words_path": "keep_words.dic"
          },
          "length_2_to_10_char": {
                "type": "length",
                "min": 2,
                "max": 10
              },
          "full_pinyin": {
            "keep_first_letter": "false",
            "keep_none_chinese_in_first_letter": "false",
            "type": "pinyin",
            "keep_original": "false",
            "keep_full_pinyin": "true"
          },
          "prefix_pinyin": {
            "keep_first_letter": "true",
            "none_chinese_pinyin_tokenize": "false",
            "type": "pinyin",
            "keep_original": "false",
            "keep_full_pinyin": "false"
          },
          "my_synonym_filter": {
            "type": "synonym",
            "synonyms_path": "pro_synonym.dic"
          }
        }
      }
    },
    "number_of_shards": 5,
    "number_of_replicas": 1
  }
}
本作品採用《CC 協議》,轉載必須註明作者和本文連結

相關文章