curl -XPOST 'http://localhost:9200/sy4' -d '{

        "analysis": {

            "analyzer":{

                    "mysynonym":{

   "type": "custom",

                        "tokenizer":"ik_max_word",

                        "filter":[

                            "remote_synonym"

                        ]

                    }

                },

                "filter":{

                    "remote_synonym":{

                        "expand": true,

                        "ignore_case": true,

                        "type": "dynamic_synonym",

                        "synonyms_path" :  "http://ip:port/word/getAllSynonymToTokenStream",

                        "interval": 60

                    }

                }

        }


}'


附上jar,网上下载的有bug