[go: up one dir, main page]

CN113742535A - Generalized retrieval method, device, equipment and storage medium - Google Patents

Generalized retrieval method, device, equipment and storage medium Download PDF

Info

Publication number
CN113742535A
CN113742535A CN202111031383.5A CN202111031383A CN113742535A CN 113742535 A CN113742535 A CN 113742535A CN 202111031383 A CN202111031383 A CN 202111031383A CN 113742535 A CN113742535 A CN 113742535A
Authority
CN
China
Prior art keywords
field
index
extension
fields
generalized
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.)
Pending
Application number
CN202111031383.5A
Other languages
Chinese (zh)
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.)
Shanghai Weimeng Enterprise Development Co ltd
Original Assignee
Shanghai Weimeng Enterprise Development 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 Shanghai Weimeng Enterprise Development Co ltd filed Critical Shanghai Weimeng Enterprise Development Co ltd
Priority to CN202111031383.5A priority Critical patent/CN113742535A/en
Publication of CN113742535A publication Critical patent/CN113742535A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a generalized retrieval method, a generalized retrieval device, equipment and a storage medium, wherein the method comprises the following steps: presetting a certain number of different types of index fields in an ElasticSearch index; the preset index fields are perceptive-free, reusable and controllable in different service lines; creating a database table; the database table comprises an extension field storage table for storing extension fields of different services and a field mapping table for storing the mapping relation between the extension fields and the index fields; inquiring corresponding index fields in a database table according to the requirements of the current service on the extension fields; and searching by using the searched index field. Therefore, the degree of reducing or even not needing to modify the ElasticSearch structure can be achieved, the work of importing and switching a large amount of data is saved, the cost of test regression is saved, and the phenomenon that the index of the ElasticSearch structure becomes huge without limit is prevented.

Description

Generalized retrieval method, device, equipment and storage medium
Technical Field
The present invention relates to the field of information retrieval technologies, and in particular, to a generalized retrieval method, apparatus, device, and storage medium.
Background
The ElasticSearch is a distributed, free-source search and analysis engine, applicable to all types of data including text, numeric, geospatial, structured and unstructured data, etc.
Currently, existing extension information is synchronized into an elastic search and is carried in a fixed and definite field form, which causes that fields required to be carried are more and more, the amount of stored information is also increased and unnecessary waste is caused as the retrieval requirements of different service requirements are different.
When the elastic search is applied in different service scenarios, some problems are likely to occur, for example, each time when the service side desires to add an extension field, if the change of the elastic search mapping structure is involved, the elastic search index needs to be re-established, that is, data is re-imported, and the on-line index is switched; due to the difference of service lines, the belonged commodities are different inevitably, and the difference of extension fields required by different commodities is reflected under the same elastic search index, and more extension fields are added, so that the elastic search mapping structure is continuously enlarged, the space waste is caused, and the performance is reduced; there are instances of abuse of the extension field.
Disclosure of Invention
In view of the above, the present invention provides a generalized search method, apparatus, device and storage medium, which can reduce or even eliminate the need to modify the structure of an ElasticSearch, and prevent the index from becoming huge without limitation. The specific scheme is as follows:
a generalized retrieval method, comprising:
presetting a certain number of different types of index fields in an ElasticSearch index; the preset index fields are perceptive-free, reusable and controllable in different service lines;
creating a database table; the database table comprises an extension field storage table for storing extension fields of different services and a field mapping table for storing mapping relations between the extension fields and the index fields;
inquiring a corresponding index field in the database table according to the requirement of the current service on the extension field;
and searching by using the searched index field.
Preferably, in the above generalized retrieving method provided by the embodiment of the present invention, the finding a corresponding index field in the database table according to a requirement of a current service on an extension field includes:
when the current service side needs to add an extension field, confirming the index name and the index type of a retrieval target of the extension field;
inquiring the database table, and determining unused index fields under the index name by taking the confirmed index name as an inquiry condition;
and automatically allocating a new index field from the unused index field according to the confirmed index type, establishing a mapping relation between the new index field and the extended field to be added, and storing the mapping relation in the database table.
Preferably, in the above generalized retrieving method provided by the embodiment of the present invention, after the storing into the database table, the method further includes:
and when the current service side stores data under the added extension fields, positioning the new index fields according to the database table to store the data.
Preferably, in the above generalized retrieving method provided by the embodiment of the present invention, after the storing into the database table, the method further includes:
when the other service side needs to add the extension field, the index name where the retrieval target of the extension field is located is confirmed, and the extension field can be mapped to the new index field under the index name.
Preferably, in the above generalized retrieval method provided by the embodiment of the present invention, the extension field stored in the extension field storage table includes dimension information.
Preferably, in the above generalized retrieving method provided by the embodiment of the present invention, the locating the new index field according to the database table includes:
inquiring dimension information of the added extension field from the extension field storage table;
according to the inquired dimension information, positioning the corresponding position of the dimension information in the field mapping table;
inquiring the new index field having a mapping relation with the extension field according to the positioned corresponding position;
and storing data under the inquired new index field.
Preferably, in the above generalized retrieving method provided in the embodiment of the present invention, the querying, according to a requirement of a current service for an extension field, a corresponding index field in the database table further includes:
when the current service side needs to search according to the extension field, the index field having a mapping relation with the extension field is directly inquired according to the field mapping table.
The embodiment of the invention also provides a generalized retrieval device, which comprises:
the index field presetting module is used for presetting a certain number of different types of index fields in the ElasticSearch index; the preset index fields are perceptive-free, reusable and controllable in different service lines;
the database table creating module is used for creating a database table; the database table comprises an extension field storage table for storing extension fields of different services and a field mapping table for storing mapping relations between the extension fields and the index fields;
the index field query module is used for querying a corresponding index field in the database table according to the requirement of the current service on the extension field;
and the target retrieval module is used for retrieving by utilizing the inquired index field.
The embodiment of the present invention further provides a generalized search device, which includes a processor and a memory, wherein the processor implements the generalized search method provided in the embodiment of the present invention when executing the computer program stored in the memory.
The embodiment of the present invention further provides a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the above generalized retrieval method provided by the embodiment of the present invention.
It can be seen from the above technical solutions that, the generalized retrieval method provided by the present invention includes: presetting a certain number of different types of index fields in an ElasticSearch index; the preset index fields are perceptive-free, reusable and controllable in different service lines; creating a database table; the database table comprises an extension field storage table for storing extension fields of different services and a field mapping table for storing the mapping relation between the extension fields and the index fields; inquiring corresponding index fields in a database table according to the requirements of the current service on the extension fields; and searching by using the searched index field.
The generalized retrieval method provided by the invention stores the extension fields by establishing the extension field storage table, avoids meaningless increase and is convenient to manage, weak connection is established between the extension fields and the index fields by establishing the field mapping table to weaken the binding relationship of the fields and the field types, different field types are fully reserved to achieve diversification of selection and switching, and the index fields are not sensed, reusable and controllable in the retrieval process, so that the degree of reducing or even not needing to modify the ElasticSearch structure can be achieved, the work of importing and switching a large amount of data is saved, the cost of test regression is saved, and the possibility that the indexes are infinitely large is prevented.
In addition, the invention also provides a corresponding device, equipment and a computer readable storage medium aiming at the generalized retrieval method, so that the method has higher practicability, and the device, the equipment and the computer readable storage medium have corresponding advantages.
Drawings
In order to more clearly illustrate the embodiments of the present invention or technical solutions in related arts, the drawings used in the description of the embodiments or related arts will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flowchart of a generalized search method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a generalized retrieval apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention provides a generalized retrieval method, which is based on an elastic search and comprises the following steps as shown in figure 1:
s101, presetting a certain number of different types of index fields in an elastic search index; the preset index fields are perceptive-free, reusable and controllable in different service lines;
s102, creating a database table; the database table comprises an extension field storage table for storing extension fields of different services and a field mapping table for storing the mapping relation between the extension fields and the index fields;
s103, inquiring corresponding index fields in a database table according to the requirements of the current service on the extension fields;
and S104, searching by using the searched index field.
In the generalized retrieval method provided by the embodiment of the invention, the extended field is stored by creating the extended field storage table, so that meaningless increase is avoided, management is facilitated, the weak connection is established between the extended field and the index field by creating the field mapping table to weaken the binding relationship between the field and the field type, different field types are fully reserved to achieve diversification of selection and switching, and in the retrieval process, the index field is not sensitive, reusable and controllable, so that the degree of reducing or even not modifying the ElasticSearch structure can be achieved, a large amount of data import and switching work is saved, the cost of test regression is saved, and the possibility of unlimited change of the index is prevented.
In specific implementation, in the generalized retrieving method, step S103 finds a corresponding index field in a database table according to a requirement of a current service for an extension field, where the method may include: firstly, when an extended field needs to be added at the current service side, confirming an index name and an index type of a retrieval target of the extended field; then, inquiring a database table, and determining unused index fields under the index name by taking the confirmed index name as an inquiry condition; and finally, automatically allocating a new index field from the unused index field according to the confirmed index type, establishing a mapping relation between the new index field and the extension field to be added, and storing the mapping relation in a database table. After the data is stored in the database table, when the data is stored in the added extension field at the current service side, positioning a new index field according to the database table so as to store the data.
The above steps are specific processes of a field-unaware general retrieval mode, and the following describes the above steps with a specific example:
step one, assuming that all index reserved keyword type fields in the elastic search are k _ c1 and k _ c2, and long type fields are l _ c1 and l _ c 2;
step two, a commodity extension field is expected to be added to the current service side A, the name of the commodity extension field is ext _ c1, the index name of the retrieval target is es _ index1, and the index type is keyword;
step three, querying a database table mapping _ table, taking an index name es _ index1 as a query condition, determining an index field used under the index, and assuming that k _ c1 and l _ c1 are used;
step four, automatically distributing a mapping relation named as a k _ c2 field for the type keyword of ext _ c1 and storing the mapping relation into a database table mapping _ table;
step five, when the data _1 is stored in the ext _ c1 field of the current service side A, the data is stored in the k _ c2 field under the index of the es _ index1 by positioning the data according to the database table mapping _ table.
When the service side desires to add an extension field each time, if the change of the structure of the ElasticSearch mapping is involved, it is necessary to re-establish the ElasticSearch index, that is, re-import the data and switch the indexes on the line, and re-establishing the ElasticSearch index means that the re-import of the full amount of data is required, as the service develops, the data amount increases, the cost becomes higher and higher, and in addition, the switching of the new and old indexes has an unstable factor, which easily causes the failure on the line. Therefore, the invention introduces field imperceptibility, establishes weak connection between the service extension field and the index field by designing an extension field mapping table to weaken the binding relationship between the field and the field type, and fully reserves different field types on the basis to achieve diversification of selection and switching, so that an elastic search mapping structure is not required to be changed when the extension field is added every time, thereby saving the work of importing and switching a large amount of data and the cost of test regression.
In addition, in a specific implementation, in the above generalized retrieving method, step S103 queries, according to a requirement of the current service for the extension field, a corresponding index field in a database table, and may further include: when the current service side needs to search according to the extension field, the index field having a mapping relation with the extension field is directly inquired according to the field mapping table. That is, when the service side a has a search appeal, the incoming ext _ c1 can be directly converted into k _ c2 and searched.
In a specific implementation, after the database table is stored in the generalized retrieval method, the method may further include: when the other service side needs to add the extension field, the index name where the retrieval target of the extension field is located is confirmed, and the extension field can be mapped to a new index field under the index name.
The above steps are specific processes of a general search mode of field multiplexing, and the following describes the above steps with a specific example:
step six, assuming that all index reserved keyword type fields in the elastic search are k _ c1 and k _ c2, and long type fields are l _ c1 and l _ c 2; the same as the first step;
step seven, a commodity extension field is expected to be added to the current service side B, the name of the commodity extension field is ext _ c2, the index name of the retrieval target is es _ index1, and the index type is keyword;
since the database table mapping _ table is isolated according to the service line, ext _ c2 may be mapped to field k _ c2 under the index name es _ index1, and the following specific steps may refer to steps three to five.
Since the commodities of different service lines are isolated, that is, the commodities belong to different service lines and are necessarily different, the difference of extension fields required by different commodities is reflected under the same ElasticSearch index, more and more extension fields are added, the structure of the ElasticSearch mapping is continuously enlarged, and under one service line, a plurality of fields are useless, the understanding cost of a user is increased, so that the waste of space and the reduction of performance are caused. Considering the same index structure, the difference is not the field appeal unique to each service, so that the unique fields are abstracted to reflect that the index is a meaningless field, and then the attribute characteristics of the service are included after the fields are specifically positioned to the service. Therefore, the invention introduces field multiplexing, and can well record the characteristics of different service lines, different extension fields and mapping to the same index field according to the mapping relation and the value of the service line field by designing the extension field mapping table, thereby isolating the mapping of the extension field by the service line, having the possibility of mapping the extension fields of different service lines to the same index field and compacting the structure.
In a specific implementation, in the generalized retrieval method, the extension field storage table is derived to avoid misusing the extension field at the service side, where the stored extension field may contain dimension information, so that the field scope and the value storage table may be determined. In practical application, besides storing the dimension information of the extension field, the service line, the extension field name, the extension field type, the group name and the like can also be stored; when the extension field type is used for reading data, restoring; the group name is used to provide the user with the ability to self-classify.
In a specific implementation, in the generalized search method, locating a new index field according to a database table may include: inquiring dimension information of the added extension field from the extension field storage table; according to the inquired dimension information, positioning the corresponding position of the dimension information in the field mapping table; according to the positioned corresponding position, inquiring a new index field having a mapping relation with the extension field; and storing the data under the inquired new index field.
The above steps are specific processes of a general retrieval mode of field management and control, and the following describes the above steps with a specific example:
step eight, deriving an extension field management table ext _ key _ table;
step nine, a commodity extension field is expected to be added to the current service side A, the name of the commodity extension field is assumed to be ext _ c1, meanwhile, information such as the type and dimension of the commodity extension field needs to be supplemented, field meanings are enriched, and auditing and management are facilitated;
step ten, assuming that the dimension of ext _ c1 is d _ sku, when the service side stores data into the service side, the service side can locate the database table sku _ info according to d _ sku to store the data.
Due to the generalization characteristic of the extended field mapping table, the extended field mapping table is easily abused by a service party, and the fields of the respective service lines and the index fields are mapped randomly, so that the reserved fields of the ElasticSearch are used early. Considering that the extension fields of each service line are managed, the library is required to be dropped and managed by means of the library table, since the table is designed, the content of the extension fields is naturally enriched, and the records where the values are stored are recorded. Therefore, the invention records the expanded field information of each service and the storage point position of the value thereof by introducing field management and control and designing an expanded field storage table, and then can establish a set of complete expanded field management and auditing function module based on the table, so that the information of the expanded field becomes comprehensive, thereby being capable of matching more scenes and being convenient for management.
The following describes the generalized search method provided by the embodiment of the present invention in detail by using an example:
the method comprises the following steps that firstly, 40 fields extColumn 1-extColumn 40 are reserved for all ElasticSearch indexes and are divided according to the using heat of types, wherein 15 fields of keyword types are reserved, 5 fields of text types are reserved, 5 fields of double types are reserved, 5 fields of long types are reserved, 5 fields of integer types are reserved, and 5 fields of scaled _ float _100 types are reserved;
secondly, creating an extension field storage table ext _ key table used for managing extension fields;
thirdly, creating a field mapping table ext _ mapping table used for managing the mapping relation between the extension field and the index field;
fourthly, when the service side A has an appeal of adding an extension field, the service side A is required to fill a series of description information such as an extension field name ext _ c1, an extension field dimension sku dimension, an index field type keyword, a related index name es _ index1, an extension field name, extension field grouping and the like in detail, and then the description information is written into an ext _ key table;
fifthly, inquiring an ext _ mapping table according to the service side A, the index field type keyword and the related index name es _ index1, and finding out unused index fields, such as extColumn3, by looking up which reserved fields in the ElasticSearch index are not used under the service line A;
sixthly, establishing a mapping relation between ext _ c1 and extColumn3, and storing the mapping relation into an ext _ mapping table;
seventhly, when the service side A stores data1 into the extension field ext _ c1, checking the ext _ key table, checking whether the extension field is registered in a case or not, and if so, finding a corresponding sku _ info table according to sku dimension and storing the sku _ info table into data 1;
eighthly, searching an ext _ mapping table to find the mapping extColumn3 of ext _ c1, and storing the data1 in the ElasticSearch index under the extColumn3 field;
ninthly, when the service side A needs to rely on the ext _ c1 field for retrieval, similarly, finding a corresponding mapping relation extColumn3 according to an ext _ mapping table, and then transferring to an elastic search for retrieval;
step ten, when the business side A needs to obtain a specific value of ext _ c1, similarly, finding the dimensionality of the extended field dimensionality sku according to the ext _ key table, and then obtaining data from the sku _ info table;
when the service side B needs to perform the above operations, the flow is consistent since each table is isolated by the service line.
Based on the same inventive concept, the embodiment of the present invention further provides a generalized retrieving apparatus, and as the principle of the apparatus for solving the problem is similar to the foregoing generalized retrieving method, the implementation of the apparatus may refer to the implementation of the generalized retrieving method, and repeated details are not repeated.
In specific implementation, the generalized search apparatus provided in the embodiment of the present invention, as shown in fig. 2, specifically includes:
an index field presetting module 11, configured to preset a certain number of different types of index fields in an ElasticSearch index; the preset index fields are perceptive-free, reusable and controllable in different service lines;
a database table creation module 12 for creating a database table; the database table comprises an extension field storage table for storing extension fields of different services and a field mapping table for storing the mapping relation between the extension fields and the index fields;
an index field query module 13, configured to query a corresponding index field in a database table according to a requirement of the current service for an extension field;
and the target retrieval module 14 is used for retrieving by using the inquired index field.
In the generalized retrieval device provided by the embodiment of the present invention, meaningless field increase can be avoided through interaction of the four modules, different field types are fully reserved to achieve diversification of selection and switching, a degree of reducing or even not requiring modification of an ElasticSearch structure can be achieved, a large amount of data import and switching work is omitted, cost of test regression is saved, and the possibility of unlimited and huge index change is prevented.
For more specific working processes of the modules, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
Correspondingly, the embodiment of the invention also discloses a universal retrieval device, which comprises a processor and a memory; wherein, the processor implements the generalized searching method disclosed in the foregoing embodiments when executing the computer program stored in the memory.
For more specific processes of the above method, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
Further, the present invention also discloses a computer readable storage medium for storing a computer program; the computer program, when executed by a processor, implements the generalized retrieval method disclosed above.
For more specific processes of the above method, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device, the equipment and the storage medium disclosed by the embodiment correspond to the method disclosed by the embodiment, so that the description is relatively simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
To sum up, a generalized retrieval method provided by the embodiment of the present invention includes: presetting a certain number of different types of index fields in an ElasticSearch index; the preset index fields are perceptive-free, reusable and controllable in different service lines; creating a database table; the database table comprises an extension field storage table for storing extension fields of different services and a field mapping table for storing the mapping relation between the extension fields and the index fields; inquiring corresponding index fields in a database table according to the requirements of the current service on the extension fields; and searching by using the searched index field. The generalized retrieval method stores the extension fields by creating the extension field storage table, thereby avoiding meaningless increase and facilitating management, weak connection is established between the extension fields and the index fields by creating the field mapping table to weaken the binding relationship of the fields and the field types, different field types are fully reserved to achieve diversification of selection and switching, and in the retrieval process, the index fields are not sensed, reusable and controllable, so that the degree of reducing or even not modifying the structure of the ElasticSearch can be achieved, the work of importing and switching a large amount of data is saved, the cost of test regression is saved, and the possibility that the indexes become huge without limitation is prevented. In addition, the invention also provides a corresponding device, equipment and a computer readable storage medium aiming at the generalized retrieval method, so that the method has higher practicability, and the device, the equipment and the computer readable storage medium have corresponding advantages.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The generalized searching method, apparatus, device and storage medium provided by the present invention are described in detail above, and specific examples are applied herein to illustrate the principles and embodiments of the present invention, and the description of the above embodiments is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A generalized retrieval method, comprising:
presetting a certain number of different types of index fields in an ElasticSearch index; the preset index fields are perceptive-free, reusable and controllable in different service lines;
creating a database table; the database table comprises an extension field storage table for storing extension fields of different services and a field mapping table for storing mapping relations between the extension fields and the index fields;
inquiring a corresponding index field in the database table according to the requirement of the current service on the extension field;
and searching by using the searched index field.
2. The generalized search method according to claim 1, wherein finding the corresponding index field in the database table according to the requirement of the current service on the extension field comprises:
when the current service side needs to add an extension field, confirming the index name and the index type of a retrieval target of the extension field;
inquiring the database table, and determining unused index fields under the index name by taking the confirmed index name as an inquiry condition;
and automatically allocating a new index field from the unused index field according to the confirmed index type, establishing a mapping relation between the new index field and the extended field to be added, and storing the mapping relation in the database table.
3. The generalized retrieval method of claim 2, further comprising, after said storing into said database table:
and when the current service side stores data under the added extension fields, positioning the new index fields according to the database table to store the data.
4. The generalized retrieval method of claim 3, further comprising, after said storing into said database table:
when the other service side needs to add the extension field, the index name where the retrieval target of the extension field is located is confirmed, and the extension field can be mapped to the new index field under the index name.
5. The generalized retrieval method of claim 4, wherein the extension field stored in the extension field storage table contains dimension information.
6. The generalized retrieval method of claim 5, wherein said locating the new index field according to the database table comprises:
inquiring dimension information of the added extension field from the extension field storage table;
according to the inquired dimension information, positioning the corresponding position of the dimension information in the field mapping table;
inquiring the new index field having a mapping relation with the extension field according to the positioned corresponding position;
and storing data under the inquired new index field.
7. The generalized retrieval method of claim 6, wherein the querying the database table for the corresponding index field according to the requirement of the current service for the extension field further comprises:
when the current service side needs to search according to the extension field, the index field having a mapping relation with the extension field is directly inquired according to the field mapping table.
8. A generalized search apparatus, comprising:
the index field presetting module is used for presetting a certain number of different types of index fields in the ElasticSearch index; the preset index fields are perceptive-free, reusable and controllable in different service lines;
the database table creating module is used for creating a database table; the database table comprises an extension field storage table for storing extension fields of different services and a field mapping table for storing mapping relations between the extension fields and the index fields;
the index field query module is used for querying a corresponding index field in the database table according to the requirement of the current service on the extension field;
and the target retrieval module is used for retrieving by utilizing the inquired index field.
9. A generalized retrieval device comprising a processor and a memory, wherein the processor implements the generalized retrieval method of any one of claims 1 to 7 when executing a computer program stored in the memory.
10. A computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the generalized retrieval method of any one of claims 1 through 7.
CN202111031383.5A 2021-09-03 2021-09-03 Generalized retrieval method, device, equipment and storage medium Pending CN113742535A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111031383.5A CN113742535A (en) 2021-09-03 2021-09-03 Generalized retrieval method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111031383.5A CN113742535A (en) 2021-09-03 2021-09-03 Generalized retrieval method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113742535A true CN113742535A (en) 2021-12-03

Family

ID=78735517

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111031383.5A Pending CN113742535A (en) 2021-09-03 2021-09-03 Generalized retrieval method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113742535A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114461685A (en) * 2022-04-14 2022-05-10 天津南大通用数据技术股份有限公司 Method for flexibly expanding database field
CN114896252A (en) * 2022-05-25 2022-08-12 远景智能国际私人投资有限公司 Inquiry method, device, computer equipment and storage medium for Internet of Things equipment
WO2023220973A1 (en) * 2022-05-18 2023-11-23 京东方科技集团股份有限公司 Data processing method and apparatus, and electronic device and computer-readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102708136A (en) * 2011-03-11 2012-10-03 微软公司 Indexing and searching features including using reusable index fields
US8719274B1 (en) * 2004-12-20 2014-05-06 American Megatrends, Inc. Method, system, and apparatus for providing generic database services within an extensible firmware interface environment
CN107016025A (en) * 2016-11-17 2017-08-04 阿里巴巴集团控股有限公司 A kind of method for building up and device of non-relational database index
CN108763430A (en) * 2018-05-24 2018-11-06 杭州有赞科技有限公司 Configurationization realizes that line business customizes the method, apparatus and system of retrieval
CN110019211A (en) * 2017-11-27 2019-07-16 北京京东尚科信息技术有限公司 The methods, devices and systems of association index

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8719274B1 (en) * 2004-12-20 2014-05-06 American Megatrends, Inc. Method, system, and apparatus for providing generic database services within an extensible firmware interface environment
CN102708136A (en) * 2011-03-11 2012-10-03 微软公司 Indexing and searching features including using reusable index fields
CN107016025A (en) * 2016-11-17 2017-08-04 阿里巴巴集团控股有限公司 A kind of method for building up and device of non-relational database index
CN110019211A (en) * 2017-11-27 2019-07-16 北京京东尚科信息技术有限公司 The methods, devices and systems of association index
CN108763430A (en) * 2018-05-24 2018-11-06 杭州有赞科技有限公司 Configurationization realizes that line business customizes the method, apparatus and system of retrieval

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114461685A (en) * 2022-04-14 2022-05-10 天津南大通用数据技术股份有限公司 Method for flexibly expanding database field
CN114461685B (en) * 2022-04-14 2022-07-01 天津南大通用数据技术股份有限公司 Method for flexibly expanding database field
WO2023220973A1 (en) * 2022-05-18 2023-11-23 京东方科技集团股份有限公司 Data processing method and apparatus, and electronic device and computer-readable storage medium
CN114896252A (en) * 2022-05-25 2022-08-12 远景智能国际私人投资有限公司 Inquiry method, device, computer equipment and storage medium for Internet of Things equipment

Similar Documents

Publication Publication Date Title
CN113742535A (en) Generalized retrieval method, device, equipment and storage medium
US6691123B1 (en) Method for structuring and searching information
US5237681A (en) Relational data base memory utilization analyzer
WO1992021090A9 (en) Relational data base memory utilization analyzer
US20010049676A1 (en) Method and system for retrieving data from multiple data sources using a search routing database
CN104424287B (en) Data query method and apparatus
CN105027115A (en) Query and index over documents
US20140244606A1 (en) Method, apparatus and system for storing, reading the directory index
CN102739622A (en) Expandable data storage system
CN105488050A (en) Database multi-index method, apparatus and system
CN114840487A (en) Metadata management method and device for distributed file system
JP2020522814A (en) Data processing method and apparatus for online analysis processing
CN109460409A (en) Data access method and device
CN107704475B (en) Multilayer distributed unstructured data storage method, query method and device
CN108984626B (en) Data processing method and device and server
CN111782654A (en) Method for storing data in distributed database in partition mode
CN107301249A (en) A kind of file access information recording method, system and distributed cluster system
CN112579633A (en) Data retrieval method, device, equipment and storage medium
CN115809248B (en) Data query method and device and storage medium
CN103020300A (en) Method and device for information retrieval
CN105744041A (en) Retrieval method and device for looking up contacts in address book in multiple conditions
CN109376174A (en) A kind of method and apparatus selecting database
KR100785331B1 (en) Mobile terminal and network management method that can be used for social network management
CN102915324A (en) Data storing and retrieving device and data storing and retrieving method
CN114185934A (en) Indexing and query method and system based on Tiandun database column storage

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