Search methods, devices, distributed search systems, media and software products
By using a redundant storage mechanism of index file copies in a distributed search system, the problem of inaccurate search results caused by index file loss is solved, improving the accuracy of search results and system stability, while reducing maintenance costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-09
- Publication Date
- 2026-03-13
AI Technical Summary
In existing technologies, when the index file on the disk is lost, it is impossible to obtain complete search results based on the search request, resulting in inaccurate search results.
In a distributed search system, each search node has a different index file and a copy of the index file. The index file copy is stored in at least one search node other than the search node where the index file is located. The index file copy is in working state when the search node where the corresponding index file is located cannot work properly, so as to ensure that the index file copy can work normally when the index file is lost.
It improves the accuracy of search results and the stability of the distributed search system, reduces program code redundancy, saves manpower and time costs, and reduces the workload of system function maintenance.
Smart Images

Figure CN114020698B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of search technology, and in particular to a search method, apparatus, distributed search system, medium, and program product. Background Technology
[0002] A search engine is a retrieval technology that uses specific strategies to search for keywords sent by a user's terminal device from a pre-acquired inverted index file (also known as an index file), and then returns the search results to the user's terminal device. Before providing search services to users, search engines typically need to create and store an index file based on the original data file.
[0003] In existing technologies, after creating an index file based on the original data file, the index file is usually stored on a disk in advance. When a user's terminal system sends a search request containing keywords, the system traverses all the index files on the disk according to the search request, obtains the search results, and returns them to the user's terminal device.
[0004] However, when the index file on the disk is lost, the complete search results cannot be obtained based on the search request, resulting in inaccurate search results. Summary of the Invention
[0005] This application provides a search method, apparatus, distributed search system, medium, and program product to solve the problem in the prior art that when the index file on the disk is lost, the complete search results cannot be obtained according to the search request, resulting in inaccurate search results.
[0006] In a first aspect, embodiments of this application provide a search method applied to a search engine node in a distributed search system, wherein the distributed search system further includes multiple search nodes, and the method includes:
[0007] Based on the search request sent by the user's terminal device, the search query in the search request is split and filtered according to the preset splitting degree and preset filtering characters to obtain at least one target keyword.
[0008] The at least one target keyword is sent to any one of the plurality of search nodes. Each search node contains multiple index files and multiple index file copies corresponding to multiple index files in at least one search node other than the search node. The index files in each search node are different. The index file copies are in working state when the search node where the corresponding index file is located cannot work properly.
[0009] Receive multiple search results returned by any one of the search nodes, the search results including a relevance score, the relevance score being used to indicate the degree of relevance between the search results and the at least one target keyword;
[0010] The multiple search results are sorted in descending order of relevance score, and the sorted search results are determined as the target search results.
[0011] The target search result is sent to the user's terminal device.
[0012] In one possible design of the first aspect, before splitting and filtering the search query in the search request based on the obtained search request sent by the user's terminal device, a preset splitting degree, and preset filter characters, and obtaining at least one target keyword, the method further includes:
[0013] Obtain multiple original files stored in the search engine database, extract text data from the multiple original files, and obtain multiple index files corresponding to the multiple original files;
[0014] For any given index file, generate a copy of the index file corresponding to that index file;
[0015] The plurality of index files are stored in the plurality of search nodes;
[0016] For any index file copy, the index file copy is stored in at least one search node other than the search node where the index file corresponding to the index file copy is located.
[0017] In another possible design of the first aspect, the step of splitting and filtering the search query in the search request based on the obtained search request sent by the user's terminal device, a preset splitting degree, and preset filtering characters, to obtain at least one target keyword, includes:
[0018] Based on the preset splitting degree, the search query is split to obtain multiple first keywords;
[0019] Based on the preset filter characters, the multiple keywords are filtered to obtain multiple second keywords from the multiple first keywords;
[0020] When the second keyword is a preset misspelled word, the target keyword corresponding to the second keyword is obtained according to the mapping relationship between misspelled words and keywords stored in the search engine database;
[0021] If the second keyword is a pre-defined non-misspelled word, then the second keyword will be determined as the target keyword.
[0022] Optionally, the method further includes:
[0023] Receive heartbeat information sent by the plurality of search nodes, the heartbeat information being used to indicate that the search nodes are in normal working condition;
[0024] If no heartbeat information is obtained from any search node within a preset time period, a status setting instruction is sent to at least one search node containing multiple index file copies corresponding to multiple index files in any search node. The status setting instruction is used to instruct the at least one search node to set the status of the multiple index file copies to a working state.
[0025] In another possible design of the first aspect, after obtaining at least one target keyword, the method further includes:
[0026] If any of the at least one target keywords is not recorded in the search engine hot keyword database, the target keyword is recorded in the search engine hot keyword database, and the search count corresponding to the target keyword is determined to be 1;
[0027] When any one of the at least one target keywords has been recorded in the search engine's hot keyword database, the search count of the target keyword is incremented by 1;
[0028] The search popularity of each target keyword is determined based on the number of searches corresponding to each target keyword in the search engine's hot keyword database.
[0029] Optionally, the method further includes:
[0030] Arrange each target keyword in the search engine's hot keyword library in descending order of search popularity, and obtain the sorting results;
[0031] Based on the preset number of keywords and the sorting results, at least one target recommended keyword is obtained;
[0032] Send the at least one target recommended keyword to the user's terminal device.
[0033] Optionally, determining the search popularity of each target keyword based on the search volume corresponding to each target keyword in the search engine's hot keyword database includes:
[0034] The search popularity of each target keyword is determined based on the number of searches corresponding to each target keyword in the search engine's hot keyword database and the pre-obtained mapping relationship between search counts and search popularity.
[0035] Secondly, embodiments of this application provide a search method applied to search nodes in a distributed search system, wherein the distributed search system further includes search engine nodes, and the method includes:
[0036] Receive at least one target keyword sent by the search engine node;
[0037] Send the at least one target keyword to other search nodes besides the search node;
[0038] Based on the at least one target keyword, multiple index files stored in the search node and multiple working copies of index files stored in the search node are used to obtain multiple first search results. The first search results include a relevance score, which is used to indicate the degree of relevance between the first search result and the at least one target keyword. Each search node contains multiple index files and multiple copies of index files corresponding to multiple index files in at least one other search node. The index files in each search node are different, and the index file copies are in a working state when the search node where the corresponding index file is located cannot work properly.
[0039] Receive multiple second search results sent by the other search nodes, the second search results including a relevance score, the relevance score being used to indicate the degree of relevance between the second search results and the at least one target keyword;
[0040] The plurality of first search results and the plurality of second search results are identified as the plurality of search results and sent to the search engine node.
[0041] In one possible design of the second aspect, before receiving at least one target keyword sent by the search engine node, the method further includes:
[0042] Send heartbeat information to the search engine node, the heartbeat information being used to indicate that the search node is in normal working condition.
[0043] Optionally, the method further includes:
[0044] Receive the status setting instruction sent by the search engine node;
[0045] The status of all index file copies in the search node is set to working status according to the status setting instruction.
[0046] Thirdly, embodiments of this application provide a search device applied to a search engine node in a distributed search system, wherein the distributed search system further includes multiple search nodes, and the device includes:
[0047] The processing module is used to split and filter the search statement in the search request based on the search request sent by the user's terminal device, preset the splitting degree and preset filter characters, and obtain at least one target keyword.
[0048] The sending module is used to send the at least one target keyword to any one of the plurality of search nodes. Each search node contains multiple index files and multiple index file copies corresponding to the multiple index files in at least one search node other than the search node. The index files in each search node are different, and the index file copies are in working state when the search node where the corresponding index file is located cannot work properly.
[0049] A receiving module is configured to receive multiple search results returned by any one of the search nodes, wherein the search results include a relevance score, and the relevance score is used to indicate the degree of relevance between the search results and the at least one target keyword;
[0050] The processing module is further configured to sort the multiple search results in descending order of relevance scores, and determine the sorted search results as the target search results.
[0051] The sending module is also used to send the target search result to the user's terminal device.
[0052] In one possible design of the third aspect, before the step of splitting and filtering the search query in the search request based on the obtained search request sent by the user's terminal device, pre-setting the splitting degree and pre-setting filter characters, and obtaining at least one target keyword, the processing module is further configured to:
[0053] Obtain multiple original files stored in the search engine database, extract text data from the multiple original files, and obtain multiple index files corresponding to the multiple original files;
[0054] For any given index file, generate a copy of the index file corresponding to that index file;
[0055] The plurality of index files are stored in the plurality of search nodes;
[0056] For any index file copy, the index file copy is stored in at least one search node other than the search node where the index file corresponding to the index file copy is located.
[0057] In another possible design of the third aspect, the processing module is specifically used for:
[0058] Based on the preset splitting degree, the search query is split to obtain multiple first keywords;
[0059] Based on the preset filter characters, the multiple keywords are filtered to obtain multiple second keywords from the multiple first keywords;
[0060] When the second keyword is a preset misspelled word, the target keyword corresponding to the second keyword is obtained according to the mapping relationship between misspelled words and keywords stored in the search engine database;
[0061] If the second keyword is a pre-defined non-misspelled word, then the second keyword will be determined as the target keyword.
[0062] Optionally, the receiving module is further configured to receive heartbeat information sent by the plurality of search nodes, the heartbeat information being used to indicate that the search nodes are in normal working condition;
[0063] The sending module is further configured to, if it does not obtain heartbeat information from any search node within a preset time period, send a status setting instruction to at least one search node containing multiple index file copies corresponding to multiple index files in any search node, wherein the status setting instruction is used to instruct the at least one search node to set the status of the multiple index file copies to a working state.
[0064] In another possible design of the third aspect, after obtaining at least one target keyword, the processing module is further configured to:
[0065] If any of the at least one target keywords is not recorded in the search engine hot keyword database, the target keyword is recorded in the search engine hot keyword database, and the search count corresponding to the target keyword is determined to be 1;
[0066] When any one of the at least one target keywords has been recorded in the search engine's hot keyword database, the search count of the target keyword is incremented by 1;
[0067] The search popularity of each target keyword is determined based on the number of searches corresponding to each target keyword in the search engine's hot keyword database.
[0068] Optionally, the processing module is further configured to:
[0069] Arrange each target keyword in the search engine's hot keyword library in descending order of search popularity, and obtain the sorting results;
[0070] Based on the preset number of keywords and the sorting results, at least one target recommended keyword is obtained;
[0071] Send the at least one target recommended keyword to the user's terminal device.
[0072] Optionally, the processing module is specifically used for:
[0073] The search popularity of each target keyword is determined based on the number of searches corresponding to each target keyword in the search engine's hot keyword database and the pre-obtained mapping relationship between search counts and search popularity.
[0074] Fourthly, embodiments of this application provide a search device applied to a search node in a distributed search system, the distributed search system further including a search engine node, the device comprising:
[0075] A receiving module is used to receive at least one target keyword sent by the search engine node;
[0076] A sending module is used to send the at least one target keyword to other search nodes besides the search node;
[0077] The processing module is configured to obtain multiple first search results based on the at least one target keyword, multiple index files stored in the search node, and multiple working copies of index files stored in the search node. The first search results include a relevance score, which is used to indicate the degree of relevance between the first search result and the at least one target keyword. Each search node contains multiple index files and multiple copies of index files corresponding to multiple index files in at least one other search node. The index files in each search node are different, and the copies of index files are in a working state when the search node containing the corresponding index file cannot work properly.
[0078] The receiving module is further configured to receive multiple second search results sent by the other search nodes, wherein the second search results include a relevance score, and the relevance score is used to indicate the degree of relevance between the second search results and the at least one target keyword;
[0079] The sending module is further configured to determine the plurality of first search results and the plurality of second search results as the plurality of search results, and send them to the search engine node.
[0080] In another possible design of the fourth aspect, before receiving at least one target keyword sent by the search engine node, the sending module is further configured to:
[0081] Send heartbeat information to the search engine node, the heartbeat information being used to indicate that the search node is in normal working condition.
[0082] Optionally, the receiving module is further configured to receive a status setting instruction sent by the search engine node;
[0083] The processing module is also configured to set the status of all index file copies in the search node to a working state according to the status setting instruction.
[0084] Fifthly, embodiments of this application provide a distributed search system, including:
[0085] Search engine nodes and multiple search nodes;
[0086] The search engine node is used to perform the search method described in any of the first aspects;
[0087] Each search node is used to execute the second aspect of the search method.
[0088] In a sixth aspect, embodiments of this application may provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and the search method provided by various possible designs.
[0089] In a seventh aspect, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, is used to implement the first aspect and the search methods provided by various possible designs.
[0090] The search method, apparatus, distributed search system, medium, and program products provided in this application embodiment involve a search node receiving at least one target keyword from a search engine node and forwarding the same target keyword to other search nodes. Each search node then retrieves multiple search results based on the target keyword, multiple index files stored in the search node, and multiple working copies of those index files. Even when an index file is lost, the corresponding copy remains active, enabling the retrieval of complete search results, improving the accuracy of the results, and significantly enhancing the stability of the distributed search system. Attached Figure Description
[0091] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0092] Figure 1 A schematic diagram of a distributed search system provided in an embodiment of this application;
[0093] Figure 2 A flowchart illustrating an embodiment of the search method provided in this application;
[0094] Figure 3A flowchart illustrating a second embodiment of the search method provided by the present invention;
[0095] Figure 4 A flowchart illustrating Embodiment 3 of the search method provided by the present invention;
[0096] Figure 5 A flowchart illustrating Embodiment 4 of the search method provided by the present invention;
[0097] Figure 6 This is a schematic diagram of the structure of a search device according to a first embodiment of the present application.
[0098] Figure 7 This is a schematic diagram of the structure of the search device according to Embodiment 2 of this application;
[0099] Figure 8 This is a schematic diagram of the server structure provided in an embodiment of this application.
[0100] The accompanying drawings have illustrated specific embodiments of this disclosure, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concepts of this disclosure to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0101] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0102] Before introducing the embodiments of this application, the application background of the embodiments of this application will be explained first:
[0103] A search engine is a retrieval technology that uses specific strategies to search for keywords sent by a user's terminal device, retrieving search results corresponding to those keywords from a pre-acquired inverted index file (also called an index file), and then returning these search results to the user's terminal device. The inverted index originates from the practical application of finding records based on attribute values; each entry in the inverted index file includes an attribute value and the addresses of the records that possess that attribute value.
[0104] Among them, the most representative search engines include Lucene, Solr, and Elasticsearch. Lucene is a sub-project of the Apache Software Foundation's Jakarta project group. It is an open-source full-text search engine toolkit and an architecture for a full-text search engine.
[0105] Before providing search services to users, search engines typically need to create and store index files based on the original data files. Taking a knowledge management system as an example, in existing technologies, all the functional code of the search engine is integrated into the knowledge management system. By running this functional code, unstructured data such as text and document information is extracted and processed, then transformed into structured data. This structured data is stored on the disk in the form of an inverted index. When a user's terminal system receives a search request containing keywords, the system traverses all index files on the disk according to the search request, retrieves the search results, and returns them to the user's terminal device, thus achieving full-text search.
[0106] However, when the index file on the disk is lost, the complete search results cannot be obtained based on the search request, resulting in inaccurate search results.
[0107] In addition, as business functions become more segmented, index files for different business areas need to be physically isolated. When processing index files for different business areas, it is necessary to rewrite the code for creating indexes and full-text search in the search engine. As the business scale grows larger and the division of business types becomes more detailed, the rewriting and reuse of code for the same functions becomes more frequent, requiring repetitive development and increasing code redundancy. This consumes a lot of manpower and time, increasing the difficulty of maintaining the search engine.
[0108] To address the aforementioned problems, the inventive concept of this application is as follows: When processing keyword searches, the loss of index files on the disk prevents matching keywords with the index files, thus failing to obtain complete search results and resulting in inaccurate results. Based on this, the inventors discovered that if the index files could be stored across multiple search nodes in a distributed search system, with each search node containing a different index file, and each index file having a copy stored on at least one search node other than the one containing the original index file, and the copy remaining functional even when the corresponding search node is malfunctioning—meaning that while the original index file malfunctions, its copy functions—the problem of not being able to obtain complete search results based on a search request in the prior art can be solved, thereby improving the accuracy of the obtained search results.
[0109] For example, the search method provided in the embodiments of this application can be applied to Figure 1 The diagram shows a distributed search system. Figure 1 This diagram illustrates a distributed search system provided in an embodiment of this application, used to solve the aforementioned technical problems. Figure 1 As shown, the distributed search system may include: a search engine node 11 and multiple search nodes ( Figure 1 The search engine node 11 may include search nodes 12, 13, and 14, and may also include terminal device 15 and search engine database 16 connected to search engine node 11.
[0110] Among them, search engine node 11 or each search node can be implemented through a server, and multiple search nodes can be implemented through an Elasticsearch (ES) cluster, with multiple search nodes deployed in a distributed manner in the ES cluster.
[0111] Distributed storage refers to distributed network storage technology, which disperses data across multiple independent servers. By sharing the storage load among multiple servers, it not only solves the bottleneck problem of a single storage server in traditional centralized storage systems, but also improves the reliability, availability, and scalability of the system.
[0112] In this embodiment, search engine node 11 can receive a search request sent by the user's terminal device 15 and execute the program code of the search method, sending at least one target keyword obtained through processing to search node 13. Search node 13 receives at least one target keyword sent by search engine node 11 and sends it to search nodes 12 and 14. Each search node executes the program code of the search method, causing search node 13 to obtain multiple search results and send them to search engine node 11.
[0113] Furthermore, the search engine node 11 processes multiple search results, obtains the target search result, and sends it to the user's terminal device 15.
[0114] Optionally, the search engine database 16 stores multiple original files so that the search engine node 11 can process the multiple original files to obtain the corresponding multiple index files. The search engine database 16 may also be equipped with a thesaurus, which stores the mapping relationship between misspelled words and keywords so that the search engine node 11 can process the search query in the search request according to the mapping relationship.
[0115] The search engine database 16 can be an external storage device relative to the search engine node 11. In other cases, the search engine database 16 can also be placed in the search engine node 11.
[0116] Next, the technical solutions of the present application will be described in detail through specific embodiments.
[0117] It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0118] Figure 2 FIG. is a schematic flowchart of Embodiment 1 of the search method provided by an embodiment of the present application. As Figure 2 shown, the search method may include the following steps:
[0119] S101: According to the search request sent by the user's terminal device obtained, and the preset splitting degree and preset filtering characters, split and filter the search statement in the search request to obtain at least one target keyword.
[0120] In this step, the search engine node in the distributed search system can receive the search request sent by the user's terminal device, and the search request includes the search statement. Since the index file includes the attribute value and the address corresponding to the attribute value, after obtaining the search statement, the search engine node needs to process it to obtain at least one target keyword, so that the subsequent search nodes can match the target keyword and the attribute value to obtain the search result.
[0121] Exemplarily, the preset splitting degree includes coarse granularity and fine granularity.
[0122] Optionally, the search engine node may further include multiple service interfaces. When the terminal device sends a search request to the search engine node through the Hyper Text Transfer Protocol (HTTP), the search engine node can call the corresponding service interface according to the search request.
[0123] Exemplarily, the preset filtering characters may be Chinese characters such as "de", "le", "a" and other modal particles, interjections, conjunctions, etc., or symbols such as "!", ",", ".", etc. The embodiments of the present application do not specifically limit this.
[0124] Optionally, for the specific implementation principle of this step, reference may be made to the description of the embodiments shown below Figure 5 and will not be repeated here.
[0125] S102: Send at least one target keyword to any one of the multiple search nodes.
[0126] In this step, after processing the search query to obtain at least one target keyword, the search engine node can send the at least one target keyword to any of the multiple search nodes so that the search node can process the at least one target keyword.
[0127] Each search node contains multiple index files and multiple index file copies corresponding to multiple index files in at least one other search node. The index files in each search node are different. The index file copies are in a working state when the search node containing the corresponding index file is not working properly, and in a non-working state when the search node containing the corresponding index file is working properly.
[0128] When the index file copy is functioning normally, the search node can match the index file copy with at least one target keyword. When the index file copy is not functioning normally, the search node will not be able to match the index file copy with at least one target keyword.
[0129] For any given search node, it receives at least one target keyword sent by the search engine node.
[0130] S103: Send at least one target keyword to other search nodes besides the search node.
[0131] In this step, after obtaining at least one target keyword, any search node also needs to send at least one target keyword to other search nodes besides the search node, so that each search node can match at least one target keyword with the index file in the search node, and match at least one target keyword with a working copy of the index file.
[0132] S104: Based on at least one target keyword, multiple first search results are obtained from multiple index files stored in the search node and multiple working copies of the index files stored in the search node.
[0133] In this step, the search node can match at least one target keyword with the index file in the search node, and match at least one target keyword with a working copy of the index file, thereby obtaining multiple first search results.
[0134] The file format of the index file and the copy of the index file can be set according to user needs. This application embodiment does not impose specific restrictions on the file format of the index file and the copy of the index file.
[0135] Each search node contains multiple index files and multiple copies of the index files corresponding to the multiple index files in at least one other search node. The index files in each search node are different, and the index file copies are in working condition when the search node containing the corresponding index file is not working properly.
[0136] In other words, when all search nodes are functioning normally, the index file copies in all search nodes are in a non-working state. At this time, a search node only needs to match at least one target keyword with its own index file. When any one of the search nodes fails, the corresponding index file copy in that failed search node is in a working state. The search node then matches at least one target keyword with its own index file, and also matches at least one target keyword with the working index file copy. This ensures that no data content in the index files is lost regardless of which search node fails.
[0137] Optionally, the first search result may include addresses corresponding to multiple target keywords.
[0138] The first search result includes a relevance score, which indicates the degree of relevance between the first search result and at least one target keyword.
[0139] Optionally, the relevance score of the first search result can be obtained based on the search term frequency, back document frequency, and field length criteria. The search term frequency is the historical search frequency of attribute words in the index file or a copy of the index file matching the target keyword. There is a mapping relationship between historical search frequency and historical search frequency score; the higher the frequency, the higher the frequency score. The back document frequency is the frequency of the target keyword appearing in the index file or a copy of the index file. There is a mapping relationship between appearance frequency and back document frequency score; the higher the frequency, the higher the frequency score. The field length criterion is the length of the statement containing the target keyword in the index file or a copy of the index file. There is a mapping relationship between length and length score; the longer the field, the higher the length score.
[0140] For example, a relevance score can be obtained based on historical search frequency scores, frequency scores, and length scores. Alternatively, the frequency scores, frequency scores, and length scores can be added together, and the sum can be used as the relevance score.
[0141] S105: Receive multiple second search results sent by other search nodes.
[0142] In this step, it is also necessary to receive multiple second search results sent by other search nodes, so as to process the first and second search results in the future, and send the processed multiple search results to the search engine node.
[0143] Optionally, the second search result may include addresses corresponding to multiple target keywords.
[0144] The second search result includes a relevance score, which indicates the degree of relevance between the second search result and at least one target keyword.
[0145] For example, the calculation method of the correlation score can be referred to S104, and will not be repeated here.
[0146] S106: Determine multiple first search results and multiple second search results as multiple search results and send them to the search engine node.
[0147] Correspondingly, for a search engine node, it receives multiple search results returned by any search node. These search results include a relevance score, which indicates the degree of relevance between the search result and at least one target keyword.
[0148] S107: Sort multiple search results in descending order of relevance score, and determine the sorted search results as the target search results.
[0149] In this step, since the relevance score is the degree to which the search results are related to at least one target keyword, multiple search results can be sorted in descending order of relevance score so that search results with higher relevance are placed before the target search results.
[0150] S108: Send the target search result to the user's terminal device.
[0151] In this step, the search engine node needs to send the target search results to the user's terminal device so that the terminal device can display them according to the order of the target search results, thereby making it convenient for the user to view the target search results.
[0152] Among them, since the search results that appear before the target search results are more relevant, they are more in line with the user's search needs. This can effectively prevent users from having to flip through multiple pages or browse multiple search results to obtain the content they need, thus improving the user experience.
[0153] The search method provided in this application involves a search node receiving at least one target keyword from a search engine node and forwarding the same keyword to other search nodes. Each search node then retrieves multiple search results based on the target keyword, multiple index files stored in the search node, and multiple working copies of those index files. Even when an index file is lost, the corresponding copy remains active, ensuring complete search results and improving accuracy. This significantly enhances the stability of the distributed search system.
[0154] Furthermore, the index file and its copies exist across multiple search nodes without the need for physical isolation, reducing code redundancy and saving manpower and time costs.
[0155] In existing technologies, as business demands increase, other systems need to integrate search engines. However, due to limitations in the original system architecture and framework, the search engine needs to be refactored before it can be ported to the new system. This solution, on the other hand, can be applied to any system without affecting existing business operations, thus significantly reducing the workload of system maintenance and exhibiting high compatibility.
[0156] Figure 3 This is a flowchart illustrating a second embodiment of the search method provided by the present invention, as shown below. Figure 3 As shown, based on the above embodiments, for the search engine node side, before splitting and filtering the search query in the search request according to the obtained search request sent by the user's terminal device, pre-setting the splitting degree and pre-setting filter characters, and obtaining at least one target keyword, the search method further includes the following steps:
[0157] S201: Obtain multiple original files stored in the search engine database, extract text data from the multiple original files, and obtain multiple index files corresponding to the multiple original files.
[0158] The original file can be in the format of Excel, PDF, Word, MP4, MP3, or other formats. This application embodiment does not impose specific restrictions on this.
[0159] S202: For any index file, generate a copy of the index file corresponding to that index file.
[0160] S203: Store multiple index files in multiple search nodes.
[0161] Among them, indexing is an important means of accelerating data querying. Its core principle is to continuously narrow down the range of data to be obtained in order to filter out the final desired result, while turning random events into sequential events.
[0162] In one specific implementation, when a search engine node initially stores an index file across multiple search nodes, it can distribute the multiple index files evenly across the search nodes. Subsequently, during routine maintenance, the generated index files can be retrieved at a preset first storage frequency and distributed evenly across the multiple search nodes at a preset second storage frequency.
[0163] During routine maintenance, an operation log table can be generated, which records the operations performed on the index file, such as adding, deleting, or modifying data.
[0164] The first preset storage frequency or the second preset storage frequency can be once every 1 second, once every 2 seconds, or once every 3 seconds. It can also be a frequency preset according to actual needs. This application embodiment does not limit this.
[0165] S204: For any index file copy, store the index file copy in at least one search node other than the search node where the index file corresponding to the index file copy is located.
[0166] The search method provided in this application embodiment obtains multiple original files stored in a search engine database, extracts text data from these original files, obtains multiple index files corresponding to the original files, generates a copy of any index file for each index file, stores these multiple index files in multiple search nodes, and stores any copy of an index file in at least one search node other than the search node containing the original index file. This effectively avoids the inability to obtain complete search results when index files are lost, effectively ensuring the integrity of the content in the index files.
[0167] Optionally, in some embodiments, for the search engine node side, before obtaining at least one target keyword, the search method may further include the following steps:
[0168] If any one of the at least one target keyword is not recorded in the search engine's hot keyword database, the target keyword is recorded in the database, and its corresponding search count is set to 1. If any one of the at least one target keyword is already recorded in the database, its search count is incremented by 1. The search popularity of each target keyword is determined based on its search count in the database. For example, the search popularity of each target keyword can be determined based on its search count in the database and a pre-obtained mapping between search counts and search popularity.
[0169] Optionally, in some embodiments, after determining the search popularity of each target keyword, each target keyword in the search engine hot word library can be arranged in descending order of search popularity to obtain a ranking result; based on the preset number of keywords and the ranking result, at least one target recommended keyword can be obtained; and at least one target recommended keyword can be sent to the user's terminal device.
[0170] For example, if the preset number of keywords is 5, the top 5 target recommended keywords in the sorting results will be identified as the 5 target recommended keywords, and these 5 target recommended keywords will be sent to the user's terminal device so that the user can view the target keywords with the most search volume through the terminal device later.
[0171] Figure 4 This is a flowchart illustrating Embodiment 3 of the search method provided by the present invention, as follows: Figure 4 As shown, based on the above embodiments, the search method further includes the following steps:
[0172] For search nodes, heartbeat information is sent to search engine nodes.
[0173] The heartbeat information indicates that the search node is in a normal working state.
[0174] S301: Receives heartbeat information sent by multiple search nodes.
[0175] S302: If no heartbeat information is obtained from any search node within a preset time period, a status setting instruction is sent to at least one search node containing multiple index file copies corresponding to multiple index files in any search node.
[0176] The status setting instruction is used to instruct at least one search node to set the status of multiple index file copies to the working state.
[0177] Exemplarily, the preset duration can be 2 seconds, 3 seconds, 4 seconds, etc., and can be preset according to actual requirements. The embodiments of the present application do not specifically limit this.
[0178] For the search node where the index file copy is located, the status of all index file copies in the search node is set to the working state according to the status setting instruction.
[0179] Figure 5 It is a schematic flowchart of the fourth embodiment of the search method provided by the present invention. As Figure 5 shown, on the basis of the above embodiment, S101 can be implemented through the following steps:
[0180] S401: Split the search statement to be processed according to the preset splitting degree to obtain multiple first keywords.
[0181] Among them, the preset splitting degree includes coarse granularity and fine granularity.
[0182] Exemplarily, taking the search statement to be "The Promise of the Dandelion" as an example for specific illustration, if the preset splitting degree is coarse granularity, the multiple first keywords are respectively "dandelion", "of", "promise"; if the preset splitting degree is fine granularity, the multiple first keywords are respectively "pu", "gong", "ying", "of", "yue", "ding".
[0183] S402: Filter the multiple keywords according to the preset filtering characters to obtain multiple second keywords from the multiple first keywords.
[0184] Exemplarily, the preset filtering characters can be Chinese characters such as "of", "le", "ah" and other modal particles, interjections, conjunctions, etc., and can be symbols such as "!", ",", ".", etc. The embodiments of the present application do not specifically limit this.
[0185] Exemplarily, taking the multiple first keywords as "dandelion", "of", "promise", "!" as an example for specific illustration, the search engine node needs to match the first keywords with the preset filtering characters, delete the first keywords that match the preset filtering characters, and obtain multiple second keywords from the multiple first keywords. That is to say, delete "of", "!", and the obtained second keywords are "dandelion", "promise"
[0186] S403: When the second keyword is a preset misspelled word, obtain the target keyword corresponding to the second keyword according to the mapping relationship between the misspelled word and the keyword stored in the search engine database.
[0187] Optionally, since users are likely to make mistakes during typing, such as easily typing "dandelion" as "pugongying", to avoid the situation where users cannot obtain search results due to input errors during search, a mapping relationship between misspelled words and keywords can be established in advance, such as establishing the mapping relationship between "pugongying" and "dandelion", so as to facilitate the subsequent conversion of misspelled words.
[0188] Exemplarily, taking the second keyword as "pugongying" as an example for illustration. The search engine node can obtain "dandelion" corresponding to "pugongying" according to the mapping relationship between "pugongying" and "dandelion", and use "dandelion" as the target keyword.
[0189] S404: When the second keyword is a preset non-misspelled word, the second keyword is determined as the target keyword.
[0190] In the search method provided by the embodiments of the present application, by splitting the to-be-searched sentence according to the preset splitting degree to obtain multiple first keywords, filtering the multiple keywords according to the preset filtering characters, obtaining multiple second keywords from the multiple first keywords, when the second keyword is a preset misspelled word, obtaining the target keyword corresponding to the second keyword according to the mapping relationship between misspelled words and keywords stored in the search engine database, and when the second keyword is a preset non-misspelled word, determining the second keyword as the target keyword. It can effectively avoid the situation where users cannot obtain search results due to inputting misspelled words, and improve the accuracy of search.
[0191] Optionally, in some embodiments, the search engine node can also obtain the number of times the attribute value in each index file is matched by the target keyword corresponding to the historically received search request, so as to obtain the popularity corresponding to the index file. The more times it is matched, the greater the corresponding popularity. The search engine node can also sort according to the popularity corresponding to each index file in descending order, and store the attribute values of the top 10 (or other positions) index files in the popularity term library in the search engine database, so as to facilitate the subsequent sending of the attribute values stored in the popularity term library to the user, facilitating the user to search and view them, and thus implementing functions such as search recommendation.
[0192] Optionally, in some embodiments, when a user enters a search query in the input box of a terminal device, the search engine node can obtain the user's input content, complete the user's input content based on historically received search queries, pre-set queries, and queries existing in the network, and send the completed content to the user's terminal device. If the completed content meets the user's needs, the user can click on the completed content, and the terminal device will use the completed content as the search query and send a search request to the search engine node.
[0193] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0194] Figure 6 This is a schematic diagram of the structure of a search device according to an embodiment of this application. Figure 6 As shown, the search device includes:
[0195] The processing module 61 is used to split and filter the search statement in the search request based on the search request sent by the user's terminal device, the preset splitting degree and the preset filtering characters, and to obtain at least one target keyword.
[0196] The sending module 62 is used to send at least one target keyword to any one of the multiple search nodes. Each search node contains multiple index files and multiple index file copies corresponding to the multiple index files in at least one search node other than the search node. The index files in each search node are different, and the index file copies are in working state when the search node where the corresponding index file is located cannot work properly.
[0197] The receiving module 63 is used to receive multiple search results returned by any search node. The search results include a relevance score, which is used to indicate the degree of relevance between the search results and at least one target keyword.
[0198] The processing module 61 is also used to sort multiple search results in descending order of relevance scores, and determine the sorted search results as the target search results.
[0199] The sending module 62 is also used to send the target search results to the user's terminal device.
[0200] In one possible design of this application embodiment, before the processing module 61, based on the search request sent by the user's terminal device, a preset splitting degree, and preset filter characters, splits and filters the search statement in the search request to obtain at least one target keyword, the processing module 61 is further configured to:
[0201] Retrieve multiple raw files stored in the search engine database, extract text data from the raw files, and retrieve multiple index files corresponding to the raw files;
[0202] For any given index file, generate a copy of the corresponding index file.
[0203] Storing multiple index files in multiple search nodes;
[0204] For any index file copy, store the index file copy in at least one search node other than the search node containing the index file corresponding to the index file copy.
[0205] In another possible design of this application embodiment, the processing module 61 is specifically used for:
[0206] Based on the preset splitting level, the search query is split to obtain multiple primary keywords;
[0207] Based on preset filter characters, multiple keywords are filtered to obtain multiple second keywords from multiple first keywords;
[0208] When the second keyword is a pre-defined misspelled word, the target keyword corresponding to the second keyword is obtained based on the mapping relationship between misspelled words and keywords stored in the search engine database.
[0209] If the second keyword is a pre-defined non-misspelled word, then the second keyword will be determined as the target keyword.
[0210] Optionally, the receiving module 63 is also used to receive heartbeat information sent by multiple search nodes, the heartbeat information being used to indicate that the search nodes are in normal working condition;
[0211] The sending module 62 is also used to send a status setting instruction to at least one search node containing multiple index file copies corresponding to multiple index files in any search node if the heartbeat information of any search node is not obtained within a preset time period. The status setting instruction is used to instruct at least one search node to set the status of the multiple index file copies to the working state.
[0212] In another possible design of this application embodiment, after obtaining at least one target keyword, the processing module 61 is further configured to:
[0213] If any of the target keywords is not recorded in the search engine hot keyword database, the target keyword is recorded in the search engine hot keyword database, and the search count corresponding to the target keyword is set to 1.
[0214] If any one of the target keywords has been recorded in the search engine's hot keyword database, increment the search count of the target keyword by 1.
[0215] The search popularity of each target keyword is determined by the number of searches for each target keyword in the search engine's hot keyword database.
[0216] Optionally, processing module 61 is also used for:
[0217] Arrange each target keyword in the search engine's hot keyword database in descending order of search popularity, and obtain the sorting results;
[0218] Based on the preset number of keywords and the sorting results, obtain at least one target recommended keyword;
[0219] The sending module 62 is also used to send at least one target recommended keyword to the user's terminal device.
[0220] Optionally, processing module 61 is specifically used for:
[0221] The search popularity of each target keyword is determined based on the number of searches for each target keyword in the search engine's hot keyword database and the pre-obtained mapping relationship between search volume and search popularity.
[0222] The search device provided in this application embodiment can be used to execute the search method on the search engine node side of any of the above embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0223] Figure 7 This is a schematic diagram of the structure of a second embodiment of the search device provided in this application. Figure 7 As shown, the search device includes:
[0224] The receiving module 71 is used to receive at least one target keyword sent by the search engine node;
[0225] Sending module 72 is used to send at least one target keyword to other search nodes besides the search node;
[0226] Processing module 73 is used to obtain multiple first search results based on at least one target keyword, multiple index files stored in search nodes, and multiple working copies of index files stored in search nodes. The first search results include a relevance score, which is used to represent the degree of relevance between the first search results and at least one target keyword. Each search node contains multiple index files and multiple copies of index files corresponding to multiple index files in at least one search node other than the search node. The index files in each search node are different, and the copies of index files are in a working state when the search node where the corresponding index file is located cannot work properly.
[0227] The receiving module 71 is also used to receive multiple second search results sent by other search nodes. The second search results include a relevance score, which is used to indicate the degree of relevance between the second search result and at least one target keyword.
[0228] The sending module 72 is also used to determine multiple first search results and multiple second search results as multiple search results and send them to the search engine node.
[0229] In one possible design of this application embodiment, before receiving at least one target keyword sent by the search engine node, the sending module 72 is further configured to send heartbeat information to the search engine node, the heartbeat information being used to indicate that the search node is in a normal working state.
[0230] Optionally, the receiving module 71 is also used to receive status setting instructions sent by the search engine node;
[0231] The processing module 73 is also used to set the status of all index file copies in the search node to the working state according to the status setting instruction.
[0232] The search device provided in this application embodiment can be used to execute the search method on the search node side in any of the above embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0233] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software via processing element calls; they can be fully implemented in hardware; or some modules can be implemented by processing element calls to software, while others are implemented in hardware. Additionally, these modules can be fully or partially integrated together, or implemented independently. The processing element mentioned here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed through the integrated logic circuits in the hardware of the processor element or through software instructions.
[0234] Each search node or search engine node can be implemented through a server.
[0235] Figure 8 This is a schematic diagram of the server structure provided in an embodiment of this application. Figure 8 As shown, the server may include: a processor 81, a memory 82, and computer program instructions stored in the memory 82 and executable on the processor 81. When the processor 81 executes the computer program instructions, it implements the search method provided in any of the foregoing embodiments.
[0236] Optionally, the server may also include interfaces for interacting with other devices.
[0237] Optionally, the server may also include a transceiver.
[0238] A transceiver is used to communicate with other computers; it forms a communication interface.
[0239] Optionally, in terms of hardware implementation, the above Figure 6 The embodiment shown includes receiving module 63 and sending module 62. Figure 7 In the illustrated embodiment, the receiving module 71 and the transmitting module 72 correspond to the transceiver in this embodiment. Figure 6 The processing module 61 in the illustrated embodiment and Figure 7 In the illustrated embodiment, the processing module 73 corresponds to the processor 81 in this embodiment.
[0240] Optionally, the various components of the server can be connected via a system bus.
[0241] The memory 82 can be a separate memory unit or a memory unit integrated into the processor. The number of processors can be one or more.
[0242] It should be understood that the processor 81 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0243] The system bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in the diagram, but this does not indicate that there is only one bus or one type of bus. Memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0244] All or part of the steps in the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, it performs the steps of the above-described method embodiments; and the aforementioned memory (storage medium) includes: read-only memory (ROM), RAM, flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disk, and any combination thereof.
[0245] The server provided in this application embodiment can be used to execute the search method provided in any of the above method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.
[0246] This application provides a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the search method described above.
[0247] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory, electrically erasable programmable read-only memory, erasable programmable read-only memory, programmable read-only memory, read-only memory, magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0248] Optionally, a readable storage medium can be coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Alternatively, the readable storage medium can be an integral part of the processor. Both the processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components within the device.
[0249] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium, and the at least one processor can implement the above-described search method when executing the computer program.
[0250] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A search method characterized by, The application discloses a search engine node applied to a distributed search system, wherein the distributed search system further comprises a plurality of search nodes, and the method comprises the following steps: According to a preset splitting degree, a splitting process is performed on a search statement to be searched, and a plurality of first keywords are obtained; According to a preset filtering character, a filtering process is performed on the plurality of keywords, and a plurality of second keywords are obtained from the plurality of first keywords; When the second keyword is a preset wrong keyword, a target keyword corresponding to the second keyword is obtained according to a mapping relationship between wrong keywords and keywords stored in a search engine database; When the second keyword is a non-wrong keyword, the second keyword is determined as the target keyword; At least one target keyword is sent to any search node in the plurality of search nodes, so that the any search node obtains a plurality of first search results according to at least one target keyword, a plurality of index files stored in the search node and a plurality of index file copies stored in the search node and in a working state; and the any search node sends at least one target keyword to other search nodes except the search node, and receives second search results returned by the other search nodes; a plurality of index files and a plurality of index file copies corresponding to the plurality of index files in at least one search node except the search node exist in each search node, the index files in each search node are different, and the index file copies are in a working state when the search node corresponding to the index file cannot normally work; A plurality of search results returned by the any search node are received, and the search results comprise a relevance score, wherein the relevance score is used for representing a correlation degree between the search results and the at least one target keyword; the search results comprise the first search results and the second search results; The plurality of search results are sorted according to a sequence from high to low of the relevance scores, and the sorted search results are determined as target search results; The target search results are sent to a terminal device of a user.
2. The method of claim 1, wherein, Before the splitting and filtering processes are performed on the search statement to be searched in the search request according to the obtained search request sent by the terminal device of the user, the preset splitting degree and the preset filtering character, and at least one target keyword is obtained, the method further comprises the following steps: A plurality of original files stored in a search engine database are obtained, text data in the plurality of original files is extracted, and a plurality of index files corresponding to the plurality of original files are obtained; For any index file, an index file copy corresponding to the any index file is generated; The plurality of index files are stored in the plurality of search nodes; For any index file copy, the index file copy is stored in at least one search node except the search node where the index file corresponding to the index file copy is located.
3. The method of claim 2, wherein, The method further comprises the following steps: Heartbeat information sent by the plurality of search nodes is received, and the heartbeat information is used for representing that the search node is in a normal working state. If heartbeat information of any search node is not acquired within a preset time length, at least one search node in which a plurality of index file copies corresponding to a plurality of index files in the any search node is located is sent a state setting instruction, and the state setting instruction is used to instruct the at least one search node to set states of the plurality of index file copies to a working state.
4. The method according to any one of claims 1 to 3, characterized in that, After the at least one target keyword is acquired, the method further includes: When any target keyword in the at least one target keyword is not recorded in a search engine hot keyword library, the target keyword is recorded in the search engine hot keyword library, and a search frequency corresponding to the target keyword is determined as 1; When any target keyword in the at least one target keyword is recorded in the search engine hot keyword library, the search frequency of the target keyword is increased by 1; According to the search frequency corresponding to each target keyword in the search engine hot keyword library, the search popularity of each target keyword is determined.
5. The method of claim 4, wherein, The method further includes: Each target keyword in the search engine hot keyword library is arranged in an order from high to low according to the search popularity, and an arrangement result is acquired; At least one target recommended keyword is acquired according to a preset keyword number and the arrangement result; The at least one target recommended keyword is sent to a terminal device of the user.
6. The method of claim 4, wherein, According to the search frequency corresponding to each target keyword in the search engine hot keyword library, the search popularity of each target keyword is determined, including: According to the search frequency corresponding to each target keyword in the search engine hot keyword library and a mapping relationship between a search frequency and search popularity acquired in advance, the search popularity of each target keyword is determined.
7. A search method characterized by, The method is applied to a search node in a distributed search system, the distributed search system further includes a search engine node, and the method includes: At least one target keyword sent by the search engine node is received; wherein the target keyword is obtained by the search engine node based on the following manner: a plurality of first keywords are acquired by performing splitting processing on a to-be-searched sentence according to a preset splitting degree; a plurality of second keywords are acquired from the plurality of first keywords by performing filtering processing on the plurality of keywords according to a preset filtering character; when the second keyword is a preset wrong word, a target keyword corresponding to the second keyword is acquired according to a mapping relationship between a wrong word and a keyword stored in a search engine database; when the second keyword is a preset non-wrong word, the second keyword is determined as the target keyword; The at least one target keyword is sent to other search nodes except the search node. According to the at least one target keyword, a plurality of index files stored in the search node and a plurality of index file copies in a working state stored in the search node, a plurality of first search results are obtained, the first search result including a relevance score, the relevance score being used to represent a degree of relevance of the first search result to the at least one target keyword, there being a plurality of index files in each search node and a plurality of index file copies corresponding to the plurality of index files in at least one search node other than the search node, the index files in each search node being different, and the index file copy being in a working state when the corresponding index file fails to normally work in the search node; Receiving a plurality of second search results sent by the other search nodes, the second search result including a relevance score, the relevance score being used to represent a degree of relevance of the second search result to the at least one target keyword; The plurality of first search results and the plurality of second search results are determined as the plurality of search results, and are sent to the search engine node.
8. The method of claim 7, wherein, Before the receiving the at least one target keyword sent by the search engine node, the method further comprises: Sending heartbeat information to the search engine node, the heartbeat information being used to represent that the search node is in a normal working state.
9. The method of claim 8, wherein, The method further comprises: Receiving a state setting instruction sent by the search engine node; According to the state setting instruction, setting states of all index file copies in the search node to a working state.
10. A search apparatus characterized by comprising: The application is applied to a search engine node in a distributed search system, the distributed search system further comprising a plurality of search nodes, and the device comprises: A processing module is configured to split and filter a search request in a search request sent by a terminal device of a user according to the search request, a preset splitting degree and a preset filtering character, and obtain at least one target keyword; A sending module is configured to send the at least one target keyword to any search node in the plurality of search nodes, so that the any search node obtains a plurality of first search results according to the at least one target keyword, a plurality of index files stored in the search node and a plurality of index file copies in a working state stored in the search node, and sends the at least one target keyword to other search nodes other than the search node, and receives second search results returned by the other search nodes; there being a plurality of index files in each search node and a plurality of index file copies corresponding to the plurality of index files in at least one search node other than the search node, the index files in each search node being different, and the index file copy being in a working state when the corresponding index file fails to normally work in the search node; A receiving module is configured to receive a plurality of search results returned by the any search node, the search result including a relevance score, the relevance score being used to represent a degree of relevance of the search result to the at least one target keyword; the search result including a first search result and a second search result. The processing module is further configured to sort the plurality of search results according to the relevance scores in descending order, and determine the sorted search results as target search results. The sending module is further configured to send the target search results to the terminal device of the user. The processing module is specifically configured to split the search sentence according to a preset splitting degree, and obtain a plurality of first keywords. The plurality of keywords are filtered according to preset filter characters, and a plurality of second keywords are obtained from the plurality of first keywords. When the second keyword is a preset wrong keyword, a target keyword corresponding to the second keyword is obtained according to a mapping relationship between wrong keywords and keywords stored in a search engine database. When the second keyword is a preset non-wrong keyword, the second keyword is determined as the target keyword.
11. A search apparatus characterized by comprising: The application is applied to a search node in a distributed search system, and the distributed search system further includes a search engine node. The receiving module is configured to receive at least one target keyword sent by the search engine node, wherein the target keyword is obtained by the search engine node based on the following manner: splitting a search sentence according to a preset splitting degree, and obtaining a plurality of first keywords; filtering a plurality of keywords according to preset filter characters, and obtaining a plurality of second keywords from the plurality of first keywords; when the second keyword is a preset wrong keyword, obtaining a target keyword corresponding to the second keyword according to a mapping relationship between wrong keywords and keywords stored in a search engine database; and when the second keyword is a preset non-wrong keyword, determining the second keyword as the target keyword. The sending module is configured to send the at least one target keyword to other search nodes except the search node. The processing module is configured to obtain a plurality of first search results according to the at least one target keyword, a plurality of index files stored in the search node, and a plurality of index file copies in a working state stored in the search node, wherein the first search result includes a relevance score, the relevance score is used to represent the relevance between the first search result and the at least one target keyword, there are a plurality of index files and a plurality of index file copies corresponding to the plurality of index files in at least one search node except the search node in each search node, the index files in each search node are different, and the index file copy is in a working state when the corresponding index file cannot normally work in the search node. The receiving module is further configured to receive a plurality of second search results sent by the other search nodes, wherein the second search result includes a relevance score, and the relevance score is used to represent the relevance between the second search result and the at least one target keyword. The sending module is further configured to determine the plurality of first search results and the plurality of second search results as the plurality of search results, and send the plurality of search results to the search engine node.
12. A distributed search system, characterized by The application includes: a search engine node and a plurality of search nodes. The search engine node is configured to execute the search method in any one of claims 1 to 6. The application includes: Each search node is configured to perform the search method of any one of claims 7 to 9.
13. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the search method of any one of claims 1 to 9.
14. A computer program product comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the search method of any one of claims 1 to 9.
Citation Information
Patent Citations
Index segmenting equalization based big data cloud search platform and method thereof
CN106528683A