Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. package com.au92.common.elastic;
  2.  
  3. /**
  4. * @author: p_x_c
  5. */
  6. public class ElasticConstant {
  7. /**
  8. * 配置文件中多cluster分割符号
  9. */
  10. public static final String CLUSTER_SPLIT = ",";
  11.  
  12. /**
  13. * 配置文件中es url分割符号
  14. */
  15. public static final String SCHEME_SPLIT = ":";
  16.  
  17. /**
  18. * 创建Index的请求体
  19. */
  20. public static final String CREATE_INDEX = "{\n" +
  21. " \"properties\": {\n" +
  22. " \"id\": {\n" +
  23. " \"type\": \"integer\"\n" +
  24. " },\n" +
  25. " \"userId\": {\n" +
  26. " \"type\": \"integer\"\n" +
  27. " },\n" +
  28. " \"name\": {\n" +
  29. " \"type\": \"text\",\n" +
  30. " \"analyzer\": \"ik_max_word\",\n" +
  31. " \"search_analyzer\": \"ik_smart\"\n" +
  32. " },\n" +
  33. " \"publishTime\": {\n" +
  34. " \"type\": \"date\"\n" +
  35. " },\n" +
  36. " \"url\": {\n" +
  37. " \"type\": \"text\",\n" +
  38. " \"index\": true,\n" +
  39. " \"analyzer\": \"ik_max_word\",\n" +
  40. " \"search_analyzer\": \"ik_smart\"\n" +
  41. " }\n" +
  42. " }\n" +
  43. "}";
  44. /**
  45. * ES shards数量
  46. */
  47. public static final Integer SHARDS = 3;
  48.  
  49. /**
  50. * replicas 数量
  51. */
  52. public static final Integer REPLICAS = 2;
  53.  
  54. /**
  55. * 批量操作一次最大数量
  56. */
  57. public static final Integer MAX = 9999;
  58.  
  59. /**
  60. * 超时设置
  61. */
  62. public static final int CONNECT_TIME_OUT = 1000;
  63. public static final int SOCKET_TIME_OUT = 30000;
  64. public static final int CONNECTION_REQUEST_TIME_OUT = 500;
  65.  
  66. /**
  67. * 连接数设置
  68. */
  69. public static final int MAX_CONNECT_NUM = 100;
  70. public static final int MAX_CONNECT_PER_ROUTE = 100;
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement