获取API

获取API允许你通过id从索引中获取类型化的JSON文档,如下例:

GetResponse response = client.prepareGet("twitter", "tweet", "1")
.execute()
.actionGet();

操作线程

The get API allows to set the threading model the operation will be performed when the actual execution of the API is performed on the same node (the API is executed on a shard that is allocated on the same server).

默认情况下,operationThreaded设置为true表示操作执行在不同的线程上面。下面是一个设置为false的例子。

GetResponse response = client.prepareGet("twitter", "tweet", "1")
.setOperationThreaded(false)
.execute()
.actionGet();

elasticsearch 中文API 获得(三)的更多相关文章

  1. elasticsearch 中文API 索引(三)

    索引API 索引API允许开发者索引类型化的JSON文档到一个特定的索引,使其可以被搜索. 生成JSON文档 有几种不同的方式生成JSON文档 利用byte[]或者作为一个String手动生成 利用一 ...

  2. elasticsearch 中文API facets(⑩)

    facets Elasticsearch提供完整的java API用来支持facets.在查询的过程中,将需要计数的facets添加到FacetBuilders中.然后将该FacetBuilders条 ...

  3. elasticsearch 中文API 基于查询的删除(九)

    基于查询的删除API 基于查询的删除API允许开发者基于查询删除一个或者多个索引.一个或者多个类型.下面是一个例子. import static org.elasticsearch.index.que ...

  4. elasticsearch 中文API 记数(八)

    计数API 计数API允许开发者简单的执行一个查询,返回和查询条件相匹配的文档的总数.它可以跨多个索引以及跨多个类型执行. import static org.elasticsearch.index. ...

  5. elasticsearch 中文API bulk(六)

    bulk API bulk API允许开发者在一个请求中索引和删除多个文档.下面是使用实例. import static org.elasticsearch.common.xcontent.XCont ...

  6. elasticsearch 中文API(一)

    Java API 这节会介绍elasticsearch支持的Java API.所有的elasticsearch操作都使用Client对象执行.本质上,所有的操作都是并行执行的. 另外,Client中的 ...

  7. elasticsearch 中文API river

    river-jdbc 安装 ./bin/plugin --install jdbc --url http://xbib.org/repository/org/xbib/elasticsearch/pl ...

  8. elasticsearch 中文API 更新(五)

    更新API 你能够创建一个UpdateRequest,然后将其发送给client. UpdateRequest updateRequest = new UpdateRequest(); updateR ...

  9. elasticsearch 中文API 删除(四)

    删除API 删除api允许你通过id,从特定的索引中删除类型化的JSON文档.如下例: DeleteResponse response = client.prepareDelete("twi ...

随机推荐

  1. 关于Excel的ctrl+方向键失效的解决方法

    在Excel中按方向键,出现了类似滚动条的效果,即按下,表格就往下滚了一格.正常的情况应该是选中的单元格往下移动一格.其实这是一个很正常的情况,只要按一下Scroll Lock键就可以了,对于没有Sc ...

  2. Python 正整数相加其余忽略

    从键盘上输入若干数值,对其中的正整数求和,非正整数(负整数,实数或其他符号)忽略,这个过程一直到输入“#”结束. i = 0while True: m = input("请输入一个数:&qu ...

  3. Java 多线程 - ThreadLocal

    ref: https://www.cnblogs.com/chengxiao/p/6152824.html

  4. jQuery - DOM对象和jQuery对象

    DOM对象 : 直接使用JavaScript获取的节点对象 jQuery对象 : 使用jQuery选择器获取的节点对象 DOM对象和jQuery对象分别拥有一套独立的方法, 不能混用 <scri ...

  5. from Crypto.Cipher import AES加密解密

    一.代码 from Crypto.Cipher import AES import base64 """ AES加密算法 """ #加密 d ...

  6. golang中time包的使用

    一.代码 package main; import ( "time" "fmt" ) func main() { //time.Time代表一个纳秒精度的时间点 ...

  7. tomcat下文件路径

    第一种:复制要访问的文件a.txt至tomcat安装路径下的webapps/ROOT文件夹下: 访问路径为:localhost:8080/a.txt 或者在webapps文件夹下新建一个文件夹(tes ...

  8. 微信sdk 隐藏右上角菜单项

    wx.ready(function () { // 8.3 批量隐藏菜单项 wx.hideMenuItems({ menuList: [ 'menuItem:share:qq', //分享到QQ 'm ...

  9. 141 x的平方根

    原题网址:http://www.lintcode.com/zh-cn/problem/sqrtx/ 实现 int sqrt(int x) 函数,计算并返回 x 的平方根. 您在真实的面试中是否遇到过这 ...

  10. [kuangbin带你飞]专题一 简单搜索 - F - Prime Path

    #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #i ...