Disclosure of Invention
An object of the present application is to provide a data operation method and device based on a full-text search engine, which can avoid manpower input to learn the DSL statement syntax of the full-text search engine elastic search, and can also improve the efficiency of data operation and save the labor cost.
According to one aspect of the application, a data operation method based on a full-text search engine is provided, and is applied to a client, wherein the method comprises the following steps:
presetting a preset operation rule for increasing, deleting, modifying and checking different data;
acquiring target data to be processed;
performing parameter analysis on the target data to obtain target operation parameters corresponding to the target data;
calling a target operation rule corresponding to the target operation parameter from the preset operation rules;
performing data operation on the target data according to the target operation rule to obtain a data operation result corresponding to the target data;
and sending the data operation result corresponding to the target data to a server corresponding to a full text search engine.
Further, in the above method, the method further includes:
and establishing connection with the server corresponding to the full-text search engine.
Further, in the foregoing method, the presetting of the preset operation rule for performing addition, deletion, modification and check on different data includes:
determining necessary parameters for increasing, deleting, modifying and checking different data;
and presetting corresponding preset operation rules according to different necessary parameters, wherein the different necessary parameters correspond to the different preset operation rules.
According to another aspect of the present application, there is also provided a data operation method based on a full-text search engine, applied to a server, wherein the method includes:
establishing connection with a client of a full-text search engine; the client side is preset with a preset operation rule for performing addition, deletion, modification and check on different data, after acquiring target data to be processed, the client side performs parameter analysis on the target data to obtain target operation parameters corresponding to the target data, calls the target operation rule corresponding to the target operation parameters from the preset operation rule, performs data operation on the target data according to the target operation rule to obtain a data operation result corresponding to the target data and sends the data operation result to a server side corresponding to the full-text search engine;
and receiving a data operation result of the target data sent by the client.
According to another aspect of the present application, there is also provided a non-volatile storage medium having computer-readable instructions stored thereon, which, when executed by a processor, cause the processor to implement the data manipulation method based on a full text search engine as described above.
According to another aspect of the present application, there is also provided a client for data operation based on a full text search engine, wherein the client comprises:
one or more processors;
a computer-readable medium for storing one or more computer-readable instructions,
when executed by the one or more processors, cause the one or more processors to implement a method of full text search engine-based data manipulation, such as the client described above.
According to another aspect of the present application, there is also provided a server for data operation based on a full text search engine, wherein the server includes:
one or more processors;
a computer-readable medium for storing one or more computer-readable instructions,
when executed by the one or more processors, cause the one or more processors to implement a method for full text search engine based data manipulation, such as the server described above.
Compared with the prior art, the method has the advantages that the client of the full-text search engine is used for presetting the preset operation rules for increasing, deleting, modifying and checking different data; in an actual application scene, target data to be processed is obtained, and parameter analysis is carried out on the target data to obtain target operation parameters corresponding to the target data; calling a target operation rule corresponding to the target operation parameter from the preset operation rules, and performing data operation on the target data according to the target operation rule to obtain a data operation result corresponding to the target data; and finally, the client sends the data operation result corresponding to the target data to the server corresponding to the full-text search engine, so that in an actual application scene, a developer does not need to know the DSL statement syntax of the full-text search engine Elastic search, and preset operation rules for performing addition, deletion, modification and check on different data are directly called, thereby not only avoiding the study of the DSL statement syntax of the full-text search engine Elastic search by manpower, but also improving the efficiency of data operation and saving the labor cost.
Detailed Description
The present application is described in further detail below with reference to the attached figures.
In a typical configuration of the present application, the terminal, the device serving the network, and the trusted party each include one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
According to an embodiment of an aspect of the present application, there is provided a data operation method based on a full-text search engine, and a specific interaction flow is shown in fig. 1, where the method involves a Client and a server of the full-text search engine, where the Client of the full-text search engine may preferably be a Rest High Level Client, where the method includes steps S11, S12, S13, S14, S15, and S16 executed by the Client, and steps S21 and S22 executed by the server, and specifically includes the following steps:
and step S11, the client presets a preset operation rule for performing addition, deletion, modification and check on different data. Here, the preset operation rule includes, but is not limited to, a method of creating in the Client Rest High Level Client in the full-text search engine, where the method of creating in the Client Rest High Level Client in the full-text search engine is packaged in a customized manner, so that the underlying principle simulates requests required by various full-text search engines, such as put, delete, get, and the like.
In an actual application scenario, when data needs to be operated, in step S12, the client acquires target data to be processed.
And step S13, the client analyzes the parameters of the target data to obtain target operation parameters corresponding to the target data.
Step S14, the client invokes a target operation rule corresponding to the target operation parameter from the preset operation rules.
Step S15, the client performs data operation on the target data according to the target operation rule to obtain a data operation result corresponding to the target data;
and step S16, the client sends the data operation result corresponding to the target data to a server corresponding to a full text search engine.
Step S21, the server establishes connection with the client of the full text search engine; the client side is preset with preset operation rules for performing addition, deletion, modification and check on different data, after acquiring target data to be processed, the client side performs parameter analysis on the target data to obtain target operation parameters corresponding to the target data, calls the target operation rules corresponding to the target operation parameters from the preset operation rules, performs data operation on the target data according to the target operation rules to obtain data operation results corresponding to the target data, and sends the data operation results to a server side corresponding to the full-text search engine.
Step S22, the server receives the data operation result of the target data sent by the client.
As shown in fig. 2, in an actual application scenario, when target data needs to be processed, a preset custom CRUD method is called, that is, an operation rule is preset; then, analyzing the self-defined parameters of the target data to be processed to obtain the parameters required by the full text search engine Client terminal Rest High Level Client, namely the target operating parameters corresponding to the target data, then, according to the called self-defined CRUD method, matching the target operation parameters corresponding to the target data to obtain target operation rules corresponding to the target operation parameters, finally executing the target operation rules matched by the full text search engine Client terminal Rest High Level Client to perform data operation on the target data, the data operation result corresponding to the target data is obtained, the corresponding data operation on the target data to be processed is realized by utilizing the preset operation rule, the artificial learning of SDL statement language and the like is avoided, and therefore the data operation efficiency is improved, and the investment of labor cost is saved; and finally, the client sends the data operation result corresponding to the target data to a server of a full text search engine Elasticissearch, so that the data of the client is put to the server of the full text search engine.
Following the above-described embodiments of the present application, the method further comprises:
and the client corresponding to the full-text search engine establishes connection with the server corresponding to the full-text search engine. For example, before the Client and the server corresponding to the full-text search engine perform different data operations, the Client and the server of the full-text search engine are connected by using a Client component reset High Level Client, so that the connection is established between the Client and the server, and the subsequent Client performs data operations on different data to be processed which are required to be placed in the server.
Next to the above embodiment of the present application, the step S11 preset a preset operation rule for performing addition, deletion, and modification on different data, specifically including:
determining necessary parameters for increasing, deleting, modifying and checking different data;
and presetting corresponding preset operation rules according to different necessary parameters, wherein the different necessary parameters correspond to the different preset operation rules.
For example, in the presetting process of the preset operation rule, the necessary parameters for performing the add/delete and check on different data are determined, for example, the Put operation may directly pass the objects to be stored such as index, type, etc., and storing and updating the objects such as index, type and the like, and presetting corresponding preset operation rules according to different necessary parameters, so as to reform the function of the data retrieval module, and when the user-defined retrieval method is called, namely, when the preset operation rule is called, after necessary target operation parameters such as index, type, index setter searchbuiler and appointed return object corresponding to the target data to be processed are transmitted, a target operation rule corresponding to the target operation parameter is automatically called from preset operation rules, and performing data operation on the target data to be processed according to the target operation rule, and sending a data operation result corresponding to the data operation to a server corresponding to the full-text search engine Latics research.
According to another aspect of the present application, there is also provided a non-volatile storage medium having computer-readable instructions stored thereon, which, when executed by a processor, cause the processor to implement the data manipulation method based on a full text search engine as described above.
According to another aspect of the present application, there is also provided a client for data operation based on a full text search engine, wherein the client comprises:
one or more processors;
a computer-readable medium for storing one or more computer-readable instructions,
when executed by the one or more processors, cause the one or more processors to implement a method of data manipulation for a client-based full-text search engine, as described above.
Here, for details of each embodiment in the client for data operation based on the full-text search engine, reference may be made to the corresponding part of the embodiment of the data operation method based on the full-text search engine of the client, and details are not described herein again.
According to another aspect of the present application, there is also provided a server for data operation based on a full text search engine, wherein the server includes:
one or more processors;
a computer-readable medium for storing one or more computer-readable instructions,
when executed by the one or more processors, cause the one or more processors to implement a method of data manipulation based on a full text search engine, such as the service end described above.
Here, the details of each embodiment in the server based on data operation of the full-text search engine may specifically refer to the corresponding parts of the embodiment of the data operation method based on the full-text search engine in the server, and thus, the details are not repeated herein
In summary, the application presets the preset operation rules for increasing, deleting, modifying and checking different data by using the client of the full-text search engine; in an actual application scene, target data to be processed is obtained, and parameter analysis is carried out on the target data to obtain target operation parameters corresponding to the target data; calling a target operation rule corresponding to the target operation parameter from the preset operation rules, and performing data operation on the target data according to the target operation rule to obtain a data operation result corresponding to the target data; and finally, the client sends the data operation result corresponding to the target data to the server corresponding to the full-text search engine, so that in an actual application scene, a developer does not need to know the DSL statement syntax of the full-text search engine Elastic search, and preset operation rules for performing addition, deletion, modification and check on different data are directly called, thereby not only avoiding the study of the DSL statement syntax of the full-text search engine Elastic search by manpower, but also improving the efficiency of data operation and saving the labor cost.
It should be noted that the present application may be implemented in software and/or a combination of software and hardware, for example, implemented using Application Specific Integrated Circuits (ASICs), general purpose computers or any other similar hardware devices. In one embodiment, the software programs of the present application may be executed by a processor to implement the steps or functions described above. Likewise, the software programs (including associated data structures) of the present application may be stored in a computer readable recording medium, such as RAM memory, magnetic or optical drive or diskette and the like. Additionally, some of the steps or functions of the present application may be implemented in hardware, for example, as circuitry that cooperates with the processor to perform various steps or functions.
In addition, some of the present application may be implemented as a computer program product, such as computer program instructions, which when executed by a computer, may invoke or provide methods and/or techniques in accordance with the present application through the operation of the computer. Program instructions which invoke the methods of the present application may be stored on a fixed or removable recording medium and/or transmitted via a data stream on a broadcast or other signal-bearing medium and/or stored within a working memory of a computer device operating in accordance with the program instructions. An embodiment according to the present application comprises an apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein the computer program instructions, when executed by the processor, trigger the apparatus to perform a method and/or a solution according to the aforementioned embodiments of the present application.
It will be evident to those skilled in the art that the present application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the apparatus claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.