{"action":"created","issue":{"url":"https://api.github.com/repos/bells/elasticsearch-analysis-dynamic-synonym/issues/15","repository_url":"https://api.github.com/repos/bells/elasticsearch-analysis-dynamic-synonym","labels_url":"https://api.github.com/repos/bells/elasticsearch-analysis-dynamic-synonym/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/bells/elasticsearch-analysis-dynamic-synonym/issues/15/comments","events_url":"https://api.github.com/repos/bells/elasticsearch-analysis-dynamic-synonym/issues/15/events","html_url":"https://github.com/bells/elasticsearch-analysis-dynamic-synonym/issues/15","id":198112811,"number":15,"title":"使用同义词多次请求，有很大概率请求不到数据","user":{"login":"xiaoheike","id":8709486,"avatar_url":"https://avatars.githubusercontent.com/u/8709486?v=3","gravatar_id":"","url":"https://api.github.com/users/xiaoheike","html_url":"https://github.com/xiaoheike","followers_url":"https://api.github.com/users/xiaoheike/followers","following_url":"https://api.github.com/users/xiaoheike/following{/other_user}","gists_url":"https://api.github.com/users/xiaoheike/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaoheike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaoheike/subscriptions","organizations_url":"https://api.github.com/users/xiaoheike/orgs","repos_url":"https://api.github.com/users/xiaoheike/repos","events_url":"https://api.github.com/users/xiaoheike/events{/privacy}","received_events_url":"https://api.github.com/users/xiaoheike/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-30T07:10:31Z","updated_at":"2017-01-04T06:34:55Z","closed_at":null,"body":"## 问题描述 ##\r\n* 索引配置信息\r\n```JAVA\r\n{\r\n   \"test\": {\r\n      \"aliases\": {},\r\n      \"mappings\": {\r\n         \"test\": {\r\n            \"properties\": {\r\n               \"text_1\": {\r\n                  \"type\": \"string\",\r\n                  \"analyzer\": \"synonym\"\r\n               }\r\n            }\r\n         }\r\n      },\r\n      \"settings\": {\r\n         \"index\": {\r\n            \"creation_date\": \"1482891562524\",\r\n            \"analysis\": {\r\n               \"filter\": {\r\n                  \"remote_synonym\": {\r\n                     \"type\": \"dynamic_synonym\",\r\n                     \"synonyms_path\": \"http://IP:PORT/waf_file/files/sw\",\r\n                     \"interval\": \"30\"\r\n                  }\r\n               },\r\n               \"analyzer\": {\r\n                  \"synonym\": {\r\n                     \"filter\": [\r\n                        \"remote_synonym\"\r\n                     ],\r\n                     \"tokenizer\": \"ik\"\r\n                  }\r\n               }\r\n            },\r\n            \"number_of_shards\": \"5\",\r\n            \"number_of_replicas\": \"1\",\r\n            \"uuid\": \"NMZ4fUryRXyoZ057lQrhDA\",\r\n            \"version\": {\r\n               \"created\": \"2030299\"\r\n            }\r\n         }\r\n      },\r\n      \"warmers\": {}\r\n   }\r\n}\r\n```\r\n* 创建一条数据\r\n```JAVA\r\nPUT /test/test/1?pretty=1\r\n{\r\n   \"text_1\" : \"水的密度很大\"\r\n}\r\n```\r\n* 在文件中新增同义词：`密度, density`\r\n* 查询语法\r\n```JAVA\r\nGET /test/_search\r\n{\r\n    \"query\": {\r\n        \"query_string\": {\r\n           \"default_field\": \"text_1\",\r\n           \"query\": \"density\"\r\n        }\r\n    }\r\n}\r\n```\r\n* 可以查到文档\r\n```JAVA\r\n{\r\n   \"took\": 1,\r\n   \"timed_out\": false,\r\n   \"_shards\": {\r\n      \"total\": 5,\r\n      \"successful\": 5,\r\n      \"failed\": 0\r\n   },\r\n   \"hits\": {\r\n      \"total\": 1,\r\n      \"max_score\": 0.16609077,\r\n      \"hits\": [\r\n         {\r\n            \"_index\": \"test\",\r\n            \"_type\": \"test\",\r\n            \"_id\": \"15\",\r\n            \"_score\": 0.16609077,\r\n            \"_source\": {\r\n               \"text_1\": \"水的密度很大\"\r\n            }\r\n         }\r\n      ]\r\n   }\r\n}\r\n```\r\n* 多次请求有很大概率无法检索到文档\r\n```JAVA\r\n{\r\n   \"took\": 1,\r\n   \"timed_out\": false,\r\n   \"_shards\": {\r\n      \"total\": 5,\r\n      \"successful\": 5,\r\n      \"failed\": 0\r\n   },\r\n   \"hits\": {\r\n      \"total\": 0,\r\n      \"max_score\": null,\r\n      \"hits\": []\r\n   }\r\n}\r\n```\r\n## 做过如下尝试 ##\r\n* shard = 1, replia = 1，不会出现上述问题\r\n* shard =5, replia = 1，单机两个 `ES` 组成集群，问题依旧存在\r\n* 重启`ES`，不会出现上述问题\r\n\r\n不知道问题出在哪里，需要大家的帮助"},"comment":{"url":"https://api.github.com/repos/bells/elasticsearch-analysis-dynamic-synonym/issues/comments/270303986","html_url":"https://github.com/bells/elasticsearch-analysis-dynamic-synonym/issues/15#issuecomment-270303986","issue_url":"https://api.github.com/repos/bells/elasticsearch-analysis-dynamic-synonym/issues/15","id":270303986,"user":{"login":"davidcai19840412","id":2242130,"avatar_url":"https://avatars.githubusercontent.com/u/2242130?v=3","gravatar_id":"","url":"https://api.github.com/users/davidcai19840412","html_url":"https://github.com/davidcai19840412","followers_url":"https://api.github.com/users/davidcai19840412/followers","following_url":"https://api.github.com/users/davidcai19840412/following{/other_user}","gists_url":"https://api.github.com/users/davidcai19840412/gists{/gist_id}","starred_url":"https://api.github.com/users/davidcai19840412/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidcai19840412/subscriptions","organizations_url":"https://api.github.com/users/davidcai19840412/orgs","repos_url":"https://api.github.com/users/davidcai19840412/repos","events_url":"https://api.github.com/users/davidcai19840412/events{/privacy}","received_events_url":"https://api.github.com/users/davidcai19840412/received_events","type":"User","site_admin":false},"created_at":"2017-01-04T06:34:55Z","updated_at":"2017-01-04T06:34:55Z","body":"单台机子 replia = 1 似乎没有什么意义"}}
{"actor":{"display_login":"davidcai19840412"}}