Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

DSL query method based on Elasticsearch

A query method and query statement technology, applied in special data processing applications, instruments, electronic digital data processing and other directions, can solve the problems of inconsistent query API, difficult to understand semantics, complex query syntax, etc., to reduce learning costs and improve query. Availability, easy maintenance effect

Inactive Publication Date: 2017-03-22
上海轻维软件有限公司
View PDF3 Cites 37 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, the query syntax provided by the existing Elasticsearch is complicated, and the semantics are not easy to understand. The query nesting structure combined with multiple conditions is lengthy, and it is difficult to troubleshoot errors.
In addition, the query APIs of multiple versions of Elasticsearch are inconsistent, and the business query function needs to be modified according to the upgraded version, making it difficult to upgrade

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • DSL query method based on Elasticsearch
  • DSL query method based on Elasticsearch
  • DSL query method based on Elasticsearch

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0012] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0013] figure 1 It is a schematic diagram of the Elasticsearch-based DSL query architecture of the present invention.

[0014] See figure 1 , the Elasticsearch-based DSL query method provided by the present invention comprises the following steps:

[0015] a) Add a DSL parsing engine at the Elasticsearch client layer to parse the query statement passed by the client;

[0016] b) Translate the query statement from the client into the corresponding grammar tree structure, and construct the native query function of Elasticsearch according to the depth-first traversal of the grammar tree;

[0017] c) Obtain Elasticsearch query results.

[0018] The DSL query method based on Elasticsearch provided by the present invention, the main process is realized as follows:

[0019] 1) Grammar template definition

[0020] Inheritance uses Antlr's g4 definition te...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The present invention discloses a DSL query method based on Elasticsearch, including the following steps: a) adding a DSL parsing engine to an Elasticsearch client layer, and parsing a query sentence transferred from a client; b) translating the query sentence from the client into a corresponding grammar tree structure and building a native query function of the Elasticsearch according to depth-first traversal of a grammar tree; and c) acquiring a query result of theElasticsearch. According to the present invention, secondary encapsulation of the Elasticsearch is performed by adding the DSL parsing engine to the Elasticsearch client layer, maintenance is easy, and expansibility is high. The query usability of the Elasticsearch is improved, learning costs and error rate are reduced, and it is possible to deal with various versions of Elasticsearch and reduce the impact of system upgrade.

Description

technical field [0001] The invention relates to a distributed real-time search and analysis engine, in particular to a DSL query method based on Elasticsearch. Background technique [0002] Elasticsearch is a Lucene-based search server that provides a distributed real-time search and analysis engine. Based on the RESTful interface it provides, it can well customize data retrieval and analysis services. Elasticsearch supports many query methods, one of which is DSL, which defines a query language based on the JSON data structure, that is, it writes the request in JSON and then performs related queries. [0003] As a popular enterprise-level search engine, ElasticSearch is designed for cloud computing, capable of real-time search, stable, reliable, fast, and easy to install and use. However, the query syntax provided by the existing Elasticsearch is complicated, and the semantics are not easy to understand. The query nesting structure combined with multiple conditions is leng...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30G06F9/44
CPCG06F8/315G06F16/252
Inventor 程永新宋辉张刘
Owner 上海轻维软件有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products