[go: up one dir, main page]

CN108959294B - Method and device for accessing search engine - Google Patents

Method and device for accessing search engine Download PDF

Info

Publication number
CN108959294B
CN108959294B CN201710356898.XA CN201710356898A CN108959294B CN 108959294 B CN108959294 B CN 108959294B CN 201710356898 A CN201710356898 A CN 201710356898A CN 108959294 B CN108959294 B CN 108959294B
Authority
CN
China
Prior art keywords
search engine
accessing
return value
value
annotation information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710356898.XA
Other languages
Chinese (zh)
Other versions
CN108959294A (en
Inventor
余欢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201710356898.XA priority Critical patent/CN108959294B/en
Publication of CN108959294A publication Critical patent/CN108959294A/en
Application granted granted Critical
Publication of CN108959294B publication Critical patent/CN108959294B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a method and a device for accessing a search engine, and relates to the technical field of computers. One embodiment of the method comprises: analyzing the received operation parameters by using Java reflection to obtain annotation information corresponding to the operation parameters; converting the value of the annotation information and the value of the field corresponding to the operating parameter into a return value corresponding to the operating parameter; and accessing the search engine by using the return value. The implementation mode overcomes the technical problem that repeated learning is needed when a new system is accessed, further achieves the technical effect of reducing the learning cost, and is beneficial to improving the working efficiency.

Description

Method and device for accessing search engine
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for accessing a search engine.
Background
With the development of the internet, more and more websites appear in the visual field of people. Most websites provide a function of retrieving information according to a filtering condition. A common solution is to concatenate Structured Query Language (SQL) statements to Query a database according to search conditions, so as to obtain corresponding records.
With the rapid development of services and the rapid increase of data volume, the response speed of database query is difficult to meet daily needs, and the user experience is seriously influenced. In the prior art, a database is divided horizontally, and tables in the database are divided in a table division or database division manner. However, after the split, it is difficult to satisfy the query across tables or across libraries. The distributed search engine elastic search provides a set of complete Java API (Application Programming Interface), and effectively solves the problem of cross-table or cross-library query after the database is expanded.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
because the SQL similarity and the repeatability of the search engine elastic search are high, when a new system accesses the search engine elastic search, the related application programming interface API needs to be learned, thereby increasing the learning cost.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for accessing a search engine, which can solve the problems of increased learning cost and reduced efficiency caused by repeated learning when a new system accesses the search engine.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method of accessing a search engine.
The method for accessing the search engine comprises the following steps: analyzing the received operation parameters by using Java reflection to obtain annotation information corresponding to the operation parameters; converting the value of the annotation information and the value of the field corresponding to the operating parameter into a return value corresponding to the operating parameter; and accessing the search engine by using the return value.
Optionally, in the embodiment of the present invention, parsing the received operation parameter by using Java reflection to obtain annotation information corresponding to the operation parameter includes: traversing the field of the class to which the operation parameter belongs by using Java reflection to acquire annotation information of the field.
Optionally, before accessing the search engine by using the return value, the embodiment of the present invention further includes: confirming a current operating environment; accessing a search engine using return values, comprising: and accessing the search engine according to the return value, the index address and the IP address.
Optionally, before accessing the search engine by using the return value, the embodiment of the present invention further includes: confirming a current operating environment; accessing a search engine using return values, comprising: and accessing the search engine according to the return value, the index address and the client.
To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided an apparatus for accessing a search engine.
The device for accessing the search engine in the embodiment of the invention comprises: the analysis module is used for analyzing the received operation parameters by using Java reflection so as to obtain annotation information corresponding to the operation parameters; the conversion module is used for converting the value of the annotation information and the value of the field corresponding to the operating parameter into a return value corresponding to the operating parameter; and the processing module is used for accessing the search engine by using the return value.
Optionally, the parsing module of the embodiment of the present invention is specifically configured to: traversing the field of the class to which the operation parameter belongs by using Java reflection to acquire annotation information of the field.
Optionally, the embodiment of the present invention further includes a confirmation module, configured to confirm the current operating environment; the processing module is used for: and accessing the search engine according to the return value, the index address and the IP address.
Optionally, the embodiment of the present invention further includes a confirmation module, configured to confirm the current operating environment; the processing module is used for: and accessing the search engine according to the return value, the index address and the client.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided an electronic device for a method of accessing a search engine.
An electronic device of an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method of accessing a search engine of an embodiment of the present invention.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided a computer-readable medium.
A computer-readable medium of an embodiment of the present invention has stored thereon a computer program that, when executed by a processor, implements a method of accessing a search engine of an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: because the technical means of analyzing the operation parameters to obtain the return value corresponding to the search engine is adopted, the technical problem that repeated learning is needed when a new system is accessed is solved, the technical effect of reducing the cost is achieved, and the work efficiency is favorably improved. Meanwhile, the recovery value is used for accessing the search engine Elasticissearch, so that the repetition degree of the code is effectively reduced.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
FIG. 2 is a schematic diagram of the main flow of a method of accessing a search engine according to an embodiment of the invention;
FIG. 3 is a schematic flow diagram of a particular method of accessing a search engine according to an embodiment of the invention;
FIG. 4 is a schematic flow chart illustrating the splicing and packaging of operating parameters according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of the main modules of an apparatus for accessing a search engine according to an embodiment of the present invention;
fig. 6 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
As described in the background of the present invention, in the prior art, each developer who needs to access the search engine Elasticsearch system needs to have basic knowledge of the relevant basic operations of the Elasticsearch, and needs to splice operation statements that can be recognized by the search engine Elasticsearch according to the application programming interface API provided by the developer, thereby resulting in a problem of increased learning cost. The invention analyzes the operation parameters by using Java reflection and determines the return value corresponding to the Elasticissearch engine for access, thus reducing the cost of artificial learning when a new system is accessed and improving the working efficiency.
FIG. 1 illustrates an exemplary system architecture 100 for accessing a search engine method or accessing a search engine apparatus to which embodiments of the present invention may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for shopping-like websites browsed by users using the terminal devices 101, 102, 103. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the method for accessing a search engine provided by the embodiment of the present invention is generally executed by the server 105, and accordingly, the apparatus for accessing a search engine is generally disposed in the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Fig. 2 is a schematic diagram of a main flow of a method of accessing a search engine according to an embodiment of the present invention.
As shown in fig. 2, a method for accessing a search engine according to an embodiment of the present invention mainly includes the following steps:
step S201: and analyzing the received operation parameters by using Java reflection to obtain annotation information corresponding to the operation parameters. Because the operation types are different, the operation parameters corresponding to the operation types are also different, and the annotation information corresponding to the current operation type is determined by analyzing the operation parameters, specifically, the field to which the operation parameters belong is traversed by Java reflection, and the annotation information of the field, that is, the annotation information of the operation parameters, is obtained.
In addition, in a specific embodiment, before analyzing the received operation parameters by using Java reflection, it can also be determined whether the operation parameters are null; and if not, analyzing the operation parameters. Mainly screening effective operating parameters.
Step S202: and converting the value of the annotation information and the value of the field corresponding to the operation parameter into a return value corresponding to the operation parameter. In step S201, the annotation information of the operation parameter (the annotation information corresponds to a value, that is, the value of the annotation information is obtained at the same time) is determined, and then the value of the annotation information and the value of the field corresponding to the operation parameter are converted into a return value that can be recognized by the search engine, and then the access operation can be performed using the return value.
Step S203: and accessing the search engine by using the return value. The search engine can be accessed through the confirmed return value, but in some implementation scenarios, the current usage scenario needs to be confirmed first, and then the search engine is accessed in an access mode corresponding to the current usage scenario, and specific access modes are divided into the following two cases:
in the first case, if the HTTP calling mode is adopted, the search engine is accessed according to the return value, the index address and the IP address;
and in the second case, if the Java API calling mode is adopted, the search engine is accessed according to the return value, the index address and the client.
The two situations are determined according to different use scenes, and have respective advantages and disadvantages, and the specific selection of which situation needs to be accessed depends on the use scenes.
FIG. 3 is a flowchart illustrating a particular method of accessing a search engine according to an embodiment of the invention.
As can be seen from FIG. 3, when a new system accesses the Elasticissearch, the invention provides basic functions for operating the Elasticissearch for the system, including mapping, adding, deleting, changing and searching functions, thereby reducing the learning cost of developers and the repetition degree of codes.
The specific operation process is as follows:
1. defining annotation classes with different meanings (the annotation class is contained in the subsequent java class, characters with annotations are obtained by analyzing the classes), distinguishing according to functions, and dividing into mapping annotations for generating mapping, annotations for query and the like. For special queries, such as time periods, the annotations also need to be configured with the class attributes of the corresponding join query. For queries that do not equal the value of a field, or for which a field does not exist, a corresponding annotation needs to be provided.
2. The method comprises the following steps:
a) for different Elasticissearch operation types, a field needs to be transmitted for distinguishing the operation types. Some operation types (the second type) need to utilize reflection to analyze Java classes, traverse field annotations in the classes, analyze input parameters according to different functions, and automatically splice (corresponding to a subsequent packaging process) operation statements of the Elasticissearch.
b) The Java class to be resolved is of type Object.
c) Two calling modes aiming at the Elasticissearch are a Java native API and an HTTP mode. Also the introduction of Elasticsearch related parameters is required. HTTP only needs to be incoming (ind 6& type), while Java native API also needs to be incoming to the Client of the Elasticsearch. The underlying parsing process for these two calling modes is similar.
The names involved in the present invention need to be explained:
1. elastic search: is a Lucene-based search server. It provides a distributed multi-user capability full-text search engine.
2. Inde6& Type: for the elastic search, inde6 corresponds to a library in the database, and type corresponds to a table in the database.
3. And annotating: also called metadata, a description of the code level.
4. Java reflection: an ability to access, detect, modify Java class state or behavior.
5. Class: one of the classes in Java contains type information of the created class.
6. 6ContentBuilder & QueryBuilder: classes defined in the Elasticsearch API.
7. And (5) terms query: it is sufficient that a plurality of values of a certain field satisfy one of them.
8. term query: exactly matching a field equals a specified value.
9. And (5) range query: query within range.
Further, the Java API performs the following steps:
1. and calling a corresponding method to execute subsequent operations according to different operation types.
2. A simple non-null verification is performed. Such as the operation that generates mapping, an empty object may be passed in because only information about the Class of the associated Class is needed. And other operation types, such as adding, modifying and deleting, not only need the object to be not null, but also need the id for identifying the primary key to be not null.
3. And resolving different annotation information by reflection according to different operation types. Converting it to the return value required by the operation type. E.g., mapping is generated, and a 6ContentBuilder object is returned. And if the query is carried out by multiple conditions, returning a QueryBuilder object. The batch operations supported by the adding, modifying and deleting are returned to the BulkRequestBuilder, wherein Inde6Request is added to the added BulkRequestBuilder, UpdateRequest is added to the adding modifying, and DeleteRequest is added to the deleting. (the json string field for generating a Filler Request can be shared with the http valid call for addition and modification.)
4. And calling the corresponding api to execute the operation.
The Http execution steps are similar to the Java API, but there are several differences:
1. and (3) inquiring: and (3) only receiving the return value in the step 2 of the Java api mode, converting the return value into a character string format, and combining the character string format with the http client to finish calling.
2. And adding, modifying and deleting, namely splicing into a character string only in the process of analysis, and finally completing calling by combining with the HttpClient client.
It should be noted that, in the parsing process, the fields after parsing need to be encapsulated (i.e., spliced).
Fig. 4 is a schematic flow chart of splicing and packaging the operation parameters according to the embodiment of the present invention, and the packaging process of the specific query includes the following steps:
1) the annotation of the query field defined in the first step of the present phase contains the following fields
name (field name mapping to es, directly getting middle type field name for null)
cpFieldName (name of another field in the query class of the pairing, generally used for time slot query, contract configuration at start time attribute field)
missing (whether the identification field inquires the field value is empty)
notEqual (identifying whether a field value is not equal to an incoming object field value)
2) And traversing all fields of the class to which the incoming object belongs by using reflection to judge whether the queried annotation class exists. If so, the values of the various fields in the annotation are parsed. And splicing the query builder required by the query.
In addition, the new adding and modifying process is simple, the field division condition is not needed, and only the corresponding value of the field is obtained according to the annotation for filling. Newly added, modified annotations contain the following fields:
ifSet (whether the value of this field needs to be set)
name (field name mapping to es, directly getting middle type field name for null)
setNull (in the case where this field is set, whether null is also set)
And obtaining the values of the corresponding fields in the annotation by reflection, and finally splicing the values into the required character string in the json format for subsequent operation.
The deleting process is simplest, and the subsequent operation can be completed only by the deleted id.
According to the method for accessing the search engine, provided by the embodiment of the invention, the technical means of analyzing the operation parameters to obtain the return value corresponding to the search engine is adopted, so that the technical problem that repeated learning is needed when a new system is accessed is solved, the technical effect of reducing the cost is further achieved, and the working efficiency is favorably improved. Meanwhile, the recovery value is used for accessing the search engine Elasticissearch, so that the repetition degree of the code is effectively reduced.
FIG. 5 is a schematic diagram of the main modules of an apparatus for accessing a search engine according to an embodiment of the present invention.
As shown in fig. 5, an apparatus 500 for accessing a search engine according to an embodiment of the present invention mainly includes:
the analysis module 501, the conversion module 502 and the processing module 503, wherein:
the parsing module 501 is configured to parse the received operation parameters by using Java reflection to obtain annotation information corresponding to the operation parameters; a conversion module 502, configured to convert the value of the annotation information and the value of the field corresponding to the operation parameter into a return value corresponding to the operation parameter; and a processing module 503, configured to access the search engine by using the return value.
Optionally, the parsing module 501 in the embodiment of the present invention is specifically configured to: traversing the field of the class to which the operation parameter belongs by using Java reflection to acquire annotation information of the field.
Optionally, the embodiment of the present invention further includes a confirmation module 504, configured to confirm the current operating environment; the processing module 503 is configured to: and accessing the search engine according to the return value, the index address and the IP address.
Optionally, the embodiment of the present invention further includes a confirmation module 504, configured to confirm the current operating environment; the processing module 503 is configured to: and accessing the search engine according to the return value, the index address and the client.
As can be seen from the above description, the technical means of analyzing the operation parameters to obtain the return value corresponding to the search engine is adopted, so that the technical problem that repeated learning is required when a new system is accessed is solved, the technical effect of reducing the cost is achieved, and the work efficiency is favorably improved. Meanwhile, the recovery value is used for accessing the search engine Elasticissearch, so that the repetition degree of the code is effectively reduced.
Referring now to FIG. 6, a block diagram of a computer system 600 suitable for use with a terminal device implementing an embodiment of the invention is shown. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor comprises a parsing module and a conversion module processing module. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: analyzing the received operation parameters by using Java reflection to obtain annotation information corresponding to the operation parameters; converting the value of the annotation information and the value of the field corresponding to the operating parameter into a return value corresponding to the operating parameter; and accessing the search engine by using the return value.
According to the technical scheme of the embodiment of the invention, because the technical means of analyzing the operation parameters to obtain the return value corresponding to the search engine is adopted, the technical problem that repeated learning is needed when a new system is accessed is solved, the technical effect of reducing the cost is achieved, and the working efficiency is favorably improved. Meanwhile, the recovery value is used for accessing the search engine Elasticissearch, so that the repetition degree of the code is effectively reduced.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method of accessing a search engine, comprising:
analyzing the received operation parameters by using Java reflection to obtain annotation information corresponding to the operation parameters; the operation parameters corresponding to different operation types are different, and the operation types are divided into two types, wherein one type is deletion, and the other type is modification, check and creation;
converting the value of the annotation information and the value of the field corresponding to the operating parameter into a return value corresponding to the operating parameter;
and accessing a search engine by using the return value.
2. The method of claim 1, wherein parsing the received operation parameters by using Java reflection to obtain annotation information corresponding to the operation parameters comprises:
traversing the field of the class to which the operation parameter belongs by using Java reflection to acquire annotation information of the field.
3. The method of claim 1,
before the accessing to the search engine by using the return value, the method further comprises:
confirming a current operating environment;
accessing a search engine using the return value, comprising:
and accessing the search engine according to the return value, the index address and the IP address.
4. The method of claim 1,
before the accessing to the search engine by using the return value, the method further comprises:
confirming a current operating environment;
accessing a search engine using the return value, comprising:
and accessing the search engine according to the return value, the index address and the client.
5. An apparatus for accessing a search engine, comprising:
the analysis module is used for analyzing the received operation parameters by using Java reflection so as to obtain annotation information corresponding to the operation parameters; the operation parameters corresponding to different operation types are different, and the operation types are divided into two types, wherein one type is deletion, and the other type is modification, check and creation;
the conversion module is used for converting the value of the annotation information and the value of the field corresponding to the operating parameter into a return value corresponding to the operating parameter;
and the processing module is used for accessing the search engine by using the return value.
6. The apparatus of claim 5, wherein the parsing module is specifically configured to:
traversing the field of the class to which the operation parameter belongs by using Java reflection to acquire annotation information of the field.
7. The apparatus of claim 5,
the system also comprises a confirmation module used for confirming the current operating environment;
the processing module is used for:
and accessing the search engine according to the return value, the index address and the IP address.
8. The apparatus of claim 5,
the system also comprises a confirmation module used for confirming the current operating environment;
the processing module is used for:
and accessing the search engine according to the return value, the index address and the client.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-4.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-4.
CN201710356898.XA 2017-05-19 2017-05-19 Method and device for accessing search engine Active CN108959294B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710356898.XA CN108959294B (en) 2017-05-19 2017-05-19 Method and device for accessing search engine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710356898.XA CN108959294B (en) 2017-05-19 2017-05-19 Method and device for accessing search engine

Publications (2)

Publication Number Publication Date
CN108959294A CN108959294A (en) 2018-12-07
CN108959294B true CN108959294B (en) 2021-07-13

Family

ID=64462903

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710356898.XA Active CN108959294B (en) 2017-05-19 2017-05-19 Method and device for accessing search engine

Country Status (1)

Country Link
CN (1) CN108959294B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110111203A (en) * 2019-05-05 2019-08-09 北京阿尔山金融科技有限公司 Batch process, device and the electronic equipment of business datum
CN113765913A (en) * 2021-09-02 2021-12-07 云宏信息科技股份有限公司 Method for configuring access to blacklist by Tomcat server, storage medium and Tomcat server
CN114357394B (en) * 2021-12-16 2024-08-23 绿盟科技集团股份有限公司 Data stream association identification method and device, electronic equipment and storage medium
CN114443953A (en) * 2021-12-31 2022-05-06 数字重庆大数据应用发展有限公司 Search engine semantic conversion method, system, medium and electronic device
CN115033312B (en) * 2022-08-09 2022-12-27 中化现代农业有限公司 ElasticSearch data operation method and device
CN119322792B (en) * 2024-12-19 2025-06-13 云筑信息科技(成都)有限公司 An ElasticSearch retrieval method based on Java annotations

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101131744A (en) * 2006-08-22 2008-02-27 华为技术有限公司 A method and system for realizing automatic adaptation of data object model
CN101593127A (en) * 2008-05-27 2009-12-02 商埃曲网络软件(上海)有限公司 A kind of cross-platform Jave virtual machine of Digital Television middleware system
CN101334728B (en) * 2008-07-28 2011-10-19 北京航空航天大学 Interface creating method and platform based on XML document description
CN106202207B (en) * 2016-06-28 2020-04-21 中国电子科技集团公司第二十八研究所 An Index and Retrieval System Based on HBase-ORM
CN106598573A (en) * 2016-11-11 2017-04-26 武汉斗鱼网络科技有限公司 Method and device for simplifying application program language

Also Published As

Publication number Publication date
CN108959294A (en) 2018-12-07

Similar Documents

Publication Publication Date Title
CN108959294B (en) Method and device for accessing search engine
CN113760948B (en) Data query method and device
CN110472207A (en) List generation method and device
CN106687955B (en) Simplifying invocation of an import procedure to transfer data from a data source to a data target
WO2021023149A1 (en) Method and apparatus for dynamically returning message
CN113282591B (en) Authority filtering method, authority filtering device, computer equipment and storage medium
CN113419740B (en) Program data stream analysis method and device, electronic equipment and readable storage medium
CN113760890A (en) Method and device for relational database management
CN110689268A (en) Method and device for extracting indexes
CN113760240A (en) Method and device for generating data model
CN111125064A (en) Method and device for generating database mode definition statement
CN113656737A (en) Web page content display method, device, electronic device and storage medium
CN113760969B (en) A data query method and device based on ElasticSearch
CN113760961B (en) Data query method and device
CN107341217B (en) Data acquisition method and equipment
CN116303428A (en) Data processing method and device
CN113468529B (en) Data searching method and device
CN110688355A (en) Method and device for changing container state
CN113190236A (en) HQL script checking method and device
CN110471708B (en) Method and device for acquiring configuration items based on reusable components
CN118069723A (en) Method, device, equipment and medium for converting file format in database
CN113312053A (en) Data processing method and device
US12001458B2 (en) Multi-cloud object store access
CN111310076A (en) Geographic position query method, device, medium and electronic equipment
CN112988778A (en) Method and device for processing database query script

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant