elastic_search_mappings.py 829 B

12345678910111213141516171819202122232425262728293031
  1. es_index = "meta_articles_v1"
  2. es_settings = {
  3. "number_of_shards": 3,
  4. "number_of_replicas": 1,
  5. "analysis": {
  6. "analyzer": {
  7. "ik_smart": {"type": "ik_smart"},
  8. "ik_max_word": {"type": "ik_max_word"},
  9. }
  10. },
  11. }
  12. es_mappings = {
  13. "properties": {
  14. "auto_id": {
  15. "type": "long",
  16. "doc_values": True,
  17. },
  18. "article_id": {"type": "long"},
  19. "platform": {"type": "keyword"},
  20. "out_account_id": {"type": "keyword"},
  21. "title": {
  22. "type": "text",
  23. "analyzer": "ik_max_word",
  24. "search_analyzer": "ik_smart",
  25. "fields": {"keyword": {"type": "keyword", "ignore_above": 256}},
  26. },
  27. "created_at": {"type": "date", "format": "yyyy-MM-dd HH:mm:ss||epoch_millis"},
  28. }
  29. }