goelastic支持同时从多个index查询结果

func (this *TestQueryRequest) Test106_IndexOne() {
    //req
    var req = this.queryRequest
    req.PageSize = 3
    req.PageCurrent = 1
    req.IndexName = "test_contact_contact_person,dev_contact_contact_person"
    req.Source = "id,name"
    //req.AttachResp = true
    result, err := req.Query()
    if err != nil {
       logrus.Error(err)
    }
    logrus.Info(result)
    //check
    this.Equal(200, result.Code)

}

INFO[2024-08-822 21:20:45]D:/go-ichub/git.ichub.com/webcli120/test/estest/query_request_test.go:389 git.ichub.com/general/webcli120/test/estest.(*TestQueryRequest).Test106_IndexOne() {
     "page_size": 3,
     "current": 1,
     "order_by": [],
     "fields": [],
     "es_bool_type": 3,
     "cmd_category": 5,
 
     "index_alias": "",
     "index_name": "test_contact_contact_person,dev_contact_contact_person",
     "cmd_type": 0,
     "source": "id,name",
     "search_type": "",
     "max_response_size": 0,
     "track_total_hits": null,
     "es_agg_dtos": [],
     "page_es_requests": [],
     "page_es_bool_types": [],
     "request_id": "e5a8d944-724e-4906-80d6-993faf9a0047"
}

{
     "code": 200,
     "msg": "成功",
     "data": [
          {
               "id": "722634537327788033",
               "index": "dev_contact_contact_person",
               "name": "金龙"
          },
          {
               "name": "金龙",
               "id": "722634539013832705",
               "index": "dev_contact_contact_person"
          },
          {
               "name": "小马",
               "id": "722820040211103745",
               "index": "dev_contact_contact_person"
          }
     ],
     "request_id": "e5a8d944-724e-4906-80d6-993faf9a0047",
     "total": 10000,
     "page_size": 3,
     "current": 1

  • 4
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

leijmdas

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值