Easy-Es Easy-Es
💋Home
  • v2.0.0(current version)
  • What's New

    • What' s New In Easy-Es v2.0.0?
  • history version

    • v1.x.x
  • Upgrade guide

    • Upgrade to 2.x.x instructions
💖Support
  • OS Community
  • Recommend Goods
  • Project PPT (opens new window)
  • Project introduction
  • Project members
  • PR
Join
Customer
  • Doc-Apis (opens new window)
  • Fitness plan automatic generation system (opens new window)
  • Vuepress-theme-vdoing (opens new window)
  • Gitee (opens new window)
  • Github (opens new window)
  • 简体中文 (opens new window)
  • English (opens new window)

adv display by random ❤️become sponsor
💋Home
  • v2.0.0(current version)
  • What's New

    • What' s New In Easy-Es v2.0.0?
  • history version

    • v1.x.x
  • Upgrade guide

    • Upgrade to 2.x.x instructions
💖Support
  • OS Community
  • Recommend Goods
  • Project PPT (opens new window)
  • Project introduction
  • Project members
  • PR
Join
Customer
  • Doc-Apis (opens new window)
  • Fitness plan automatic generation system (opens new window)
  • Vuepress-theme-vdoing (opens new window)
  • Gitee (opens new window)
  • Github (opens new window)
  • 简体中文 (opens new window)
  • English (opens new window)
  • Quick start

    • Introduction.md
    • Applicable scene
    • Worry free
    • Avoid pit
    • Quick start
    • Springboot demo
    • Spring Integration Guide
    • Solon Integration Guide
    • Config
    • Annotation
  • Core function

    • Condition constructor

      • Introduction of Wrapper
      • Index wrapper
      • Select wrapper
      • Update wrapper
    • Index CRUD

      • Index hosting model
      • Index CRUD
    • Data CRUD

      • Data synchronization solutions
      • Data CRUD
    • Multiple data sources support
    • Dynamic indexing support
    • Four nested query
    • Chain call
  • Extended function

    • Mixed query
    • Origin query
    • Page
    • Nested
    • Join parent child
    • Get DSL
    • ExecuteDSL
      • DSL statement support
      • Use
    • Execute SQL
    • Custom RequestOptions
    • Custom default method
  • High-level syntax

    • Field filtering
    • Sort
    • Aggregation
    • Match&fuzzy match
    • Weight
    • Highlight
    • Geo
    • IP
  • Plugin

    • Plugin
  • Other

    • Faq
    • Difference from MP
    • MySQL and EE syntax comparison
    • Update log
    • Update plan
    • Copyright
    • Thanks
  • v2.xDoc
  • Extended function
LaoHan
2023-03-18
目录

ExecuteDSL

# DSL statement support

Some users expect to use the function of RestLowLevelClient to execute existing DSL statements, and realize the effect similar to that of executing DSL on xpack or es-head. So we encapsulated the implementation of DSL-API out of the box.

API

//The static dsl statement is executed without passing the index name. By default, it is the index corresponding to the current mapper.
String executeDSL(String dsl);
//Execute a static dsl statement to specify the active index.
String executeDSL(String dsl, String indexName);
1
2
3
4

# Use

@Test
public void testDSL() {
String DSL = "{\" size \ ":10000, \" query \ ":{\" bool \ ":{\" must \ ":[{\" $ TERM \ ":{\" title. keyword \ ":{\" value. "adjust_pure_negative\":true,\"boost\":1.0}}\"track_total_hits\":2147483647}";
String jsonResult = documentMapper.executeDSL(dsl);
//Note that after execution, it is returned in JSON format, which is parsed by the user as required.
System.out.println(jsonResult);
}
1
2
3
4
5
6
7
Help us improve this document (opens new window)
Last update: 2024/03/29
Get DSL
Execute SQL

← Get DSL Execute SQL→

Theme by Vdoing | Copyright © 2021-2025 LaoHan | Zhejiang ICP No. 2022020479 | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式