• 大小: 48KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-15
  • 语言: Java
  • 标签: ES  

资源简介

Elasticsearch5.5.1 JAVA客户端TransportClient相关的示例,包含CRUD,bulk,相关介绍请参考:http://blog.csdn.net/u011781521/article/details/77848489

资源截图

代码片段和文件信息

package com.fendo.temp;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.StringReader;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutionException;

import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.action.get.MultiGetItemResponse;
import org.elasticsearch.action.get.MultiGetResponse;
import org.elasticsearch.index.query.MatchQueryBuilder;
import org.elasticsearch.action.ActionFuture;
import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest;
import org.elasticsearch.action.admin.indices.analyze.AnalyzeResponse;
import org.elasticsearch.script.script;
import org.elasticsearch.script.scriptType;
import org.elasticsearch.index.query.MultiMatchQueryBuilder;
import org.elasticsearch.index.query.MatchPhrasePrefixQueryBuilder;
import org.elasticsearch.index.query.MatchPhraseQueryBuilder;
import org.elasticsearch.action.search.MultiSearchResponse;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import org.apache.lucene.search.join.ScoreMode;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder;
import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse;
import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsRequest;
import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsResponse;
import org.elasticsearch.action.bulk.BulkRequestBuilder;
import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.delete.DeleteResponse;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.search.SearchRequestBuilder;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.search.SearchType;
import org.elasticsearch.action.update.UpdateRequest;
import org.elasticsearch.action.update.UpdateResponse;
import org.elasticsearch.client.Response;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.elasticsearch.common.unit.Fuzziness;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.index.que

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-09-04 21:32  TransportClient\
     文件        1393  2017-09-04 20:12  TransportClient\.classpath
     文件        1091  2017-08-31 09:50  TransportClient\.project
     目录           0  2017-09-04 20:13  TransportClient\.settings\
     文件         572  2017-08-30 13:33  TransportClient\.settings\.jsdtscope
     文件          57  2017-09-04 20:13  TransportClient\.settings\org.eclipse.core.resources.prefs
     文件         736  2017-08-31 09:50  TransportClient\.settings\org.eclipse.jdt.core.prefs
     文件         142  2017-09-04 20:12  TransportClient\.settings\org.eclipse.m2e.core.prefs
     文件         686  2017-08-30 13:33  TransportClient\.settings\org.eclipse.wst.common.component
     文件         252  2017-08-30 13:33  TransportClient\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2017-08-30 13:33  TransportClient\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2017-08-30 13:33  TransportClient\.settings\org.eclipse.wst.jsdt.ui.superType.name
     文件        1410  2017-09-04 21:32  TransportClient\article
     目录           0  2017-08-31 14:52  TransportClient\logs\
     文件       22014  2017-09-04 22:41  TransportClient\logs\test.log
     文件        7532  2017-09-04 20:26  TransportClient\pom.xml
     目录           0  2017-08-31 14:52  TransportClient\src\
     目录           0  2017-08-31 14:52  TransportClient\src\main\
     目录           0  2017-08-31 14:52  TransportClient\src\main\java\
     目录           0  2017-08-31 14:52  TransportClient\src\main\java\com\
     目录           0  2017-08-31 14:52  TransportClient\src\main\java\com\fendo\
     目录           0  2017-08-31 14:52  TransportClient\src\main\java\com\fendo\temp\
     文件       58724  2017-09-05 10:40  TransportClient\src\main\java\com\fendo\temp\TransportClientTest.java
     目录           0  2017-08-31 14:52  TransportClient\src\main\resources\
     文件        8141  2017-09-04 21:04  TransportClient\src\main\resources\bulk.txt
     文件         742  2017-08-22 20:43  TransportClient\src\main\resources\log4j2.xml
     目录           0  2017-08-31 14:52  TransportClient\src\main\webapp\
     文件          57  2017-08-30 13:31  TransportClient\src\main\webapp\index.jsp
     目录           0  2017-08-31 14:52  TransportClient\src\main\webapp\meta-INF\
     文件          39  2017-08-30 13:33  TransportClient\src\main\webapp\meta-INF\MANIFEST.MF
     目录           0  2017-08-31 14:52  TransportClient\src\main\webapp\WEB-INF\
............此处省略14个文件信息

评论

共有 条评论