本文整理汇总了Java中com.searchly.jestdroid.JestClientFactory类的典型用法代码示例。如果您正苦于以下问题:Java JestClientFactory类的具体用法?Java JestClientFactory怎么用?Java JestClientFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JestClientFactory类属于com.searchly.jestdroid包,在下文中一共展示了JestClientFactory类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getClient
import com.searchly.jestdroid.JestClientFactory; //导入依赖的package包/类
/**
* Gets the jest client for the profiles storage using the application.
*
* @return this.mClient The client(user) of the application.
*/
public JestClient getClient() {
JestClient client;
DroidClientConfig clientConfig = new DroidClientConfig.Builder(
SEARCHLY_CLUSTER).build();
JestClientFactory jestClientFactory = new JestClientFactory();
jestClientFactory.setDroidClientConfig(clientConfig);
client = jestClientFactory.getObject();
return client;
}
示例2: getProfileClient
import com.searchly.jestdroid.JestClientFactory; //导入依赖的package包/类
/**
* Gets the jest client using the application.
*
* @return this.mClient The client(user) of the application.
*/
public JestClient getProfileClient() {
JestClient client;
DroidClientConfig clientConfig = new DroidClientConfig.Builder(
SEARCHLY_PROFILES).build();
JestClientFactory jestClientFactory = new JestClientFactory();
jestClientFactory.setDroidClientConfig(clientConfig);
client = jestClientFactory.getObject();
return client;
}
示例3: ElasticSearchHandler
import com.searchly.jestdroid.JestClientFactory; //导入依赖的package包/类
/**
* And constructor with optional parameters to connect to a different server,
* index, or type. Used for testing so questions aren't pushed to
* the main index when tests are run.
* @param URL The URL of the server to connect to
* @param Index The index within the server to reference
* @param Type The type i the index to save to
*/
public ElasticSearchHandler(String URL,String Index,String Type){
this.URL = URL;
INDEX=Index;
TYPE=Type;
this.queryAll="{\"query\":{\"match_all\":{}}}";
this.gson=new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").create();
JestClientFactory f=new JestClientFactory();
f.setDroidClientConfig(new DroidClientConfig.Builder(URL).discoveryEnabled(true)
.discoveryFrequency(120, TimeUnit.SECONDS).connTimeout(10000).multiThreaded(true).build());
client=f.getObject();
}
示例4: ElasticSearchHelper
import com.searchly.jestdroid.JestClientFactory; //导入依赖的package包/类
public ElasticSearchHelper(){
JestClientFactory factory = new JestClientFactory();
factory.setDroidClientConfig(new DroidClientConfig.Builder(Constants.CONNECTION_URL).build());
conn = factory.getObject();
}