其他语言的就不帖了,可以到官方站点寻找。感觉官方还是有所保留就是。使用Elasticsearch High Level写查询,相比较于sql,会有一种强烈的不适感,应该有现成的工具可以将sql脚本转化为elasticsearch High level对应的查询代码吧,在这里简单晒一下查询代码的一点神态。
不要太惊讶,就是这么晦涩与不爽的节奏!写习惯的sql,再来写这种“奇葩”的查询代码,是不是有种“生无可恋”的感受?不用太担心,关注ChinaHadoop公众号,回复”Elasticsearch”可获取一份小白 demo,初始化High Level API Client,定位index,type,多种查询条件代码,覆盖常见查询场景,完全不用烧脑,享受ChinaHadoop干货经验,快速打造自己的搜索引擎!
本文从应用的角度介绍了如何运用Elaticsearch搭建自主的搜索引擎解决方案,从环境安装、索引建立、同步索引数据,到使用Elastic High Level API进行数据查询,覆盖了一个简易自主搜索引擎的全生命周期,小白可参考本文实现一个自主搜索引擎,遇到问题可回复ChinaHadoop,得到指导与帮助。
publicvoidtestConfigureTimeout()throws Exception
{//Set timeout until a connection is established((BindingProvider)port).getRequestContext().put("javax.xml.ws.client.connectionTimeout","6000");//Set timeout until the response is received((BindingProvider) port).getRequestContext().put("javax.xml.ws.client.receiveTimeout","1000");
port.echo("testTimeout");}
代码看起来跟引入的包名匹配度高,但是实测不生效。
而Github上的资料显示,不同的环境下,采用的配置有些不一样,也没有一个统一的标准。
A little overview of several implementations:
// Weblogic JAX-WS properties
((BindingProvider) port).getRequestContext().put(“com.sun.xml.ws.connect.timeout”, timeout);
((BindingProvider) port).getRequestContext().put(“com.sun.xml.ws.request.timeout”, timeout); // JDK JAX-WS properties
((BindingProvider) port).getRequestContext().put(“com.sun.xml.internal.ws.connect.timeout”, timeout);
((BindingProvider) port).getRequestContext().put(“com.sun.xml.internal.ws.request.timeout”, timeout);
// JBOSS CXF JAX-WS properties, warning these might change in the future (CXF-5261)
((BindingProvider) port).getRequestContext().put(“javax.xml.ws.client.connectionTimeout”, timeout);
((BindingProvider) port).getRequestContext().put(“javax.xml.ws.client.receiveTimeout”, timeout);
Specifies the amount of time, in milliseconds, that the client will attempt to establish a connection before it times out. The default is 30000 (30 seconds). 0 specifies that the client will continue to attempt to open a connection indefinitely.
ReceiveTimeout
Specifies the amount of time, in milliseconds, that the client will wait for a response before it times out. The default is 60000. 0 specifies that the client will wait indefinitely.