Information retrieval method and device, equipment, medium and program product
By obtaining the number of search statements and page display elements on the user side in the Elasticsearch search engine, deep pagination search and paging processing are performed, the real-time problem of search results caused by scrolling queries is solved, paging display and page viewing are realized, and user experience is improved. .
Patent Information
- Application Number
- CN202411580316.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-25
AI Technical Summary
The scrolling query of the Elasticsearch search engine affects the real-time nature of the search results, and it is impossible to read pages, affecting the user experience.
By obtaining the search statements entered by the user, calling the engine capability of the distributed search engine for deep pagination search, identifying whether the user is visiting for the first time, obtaining the number of pagination based on the number of elements displayed on the page, and paging the candidate search result logs, obtaining Target search page collection.
The timeliness and real-time nature of the search results are optimized, pagination display and page viewing of search results are realized, and the search experience on the user side is improved.
Smart Images

Figure CN119513159A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to an information retrieval method, apparatus, device, medium and program product. Background Art
[0002] With the development of technology, more and more people are searching for information through the Elasticsearch search engine to obtain the information retrieval results they need.
[0003] In the related art, the search results of the Elasticsearch search engine can be obtained by means of scrolling query. In this scenario, since the scrolling query requires a certain amount of time to obtain the scrolling information, the real-time performance of the search results may be affected to a certain extent. In addition, the search results returned by the Elasticsearch search engine cannot be read by jumping pages, which affects the user experience. Summary of the invention
[0004] The present disclosure aims to solve one of the technical problems in the related art at least to some extent.
[0005] To this end, the first aspect of the present disclosure proposes an information retrieval method.
[0006] A second aspect of the present disclosure provides an information retrieval device.
[0007] A third aspect of the present disclosure provides an electronic device.
[0008] A fourth aspect of the present disclosure provides a non-transitory computer-readable storage medium.
[0009] A fifth aspect of the present disclosure provides a computer program product.
[0010] To achieve the above-mentioned purpose, the first aspect of the present disclosure proposes an information retrieval method, including: obtaining a search statement input by a user terminal, and obtaining the information retrieval needs of the user terminal based on the search statement; calling the engine capabilities of a distributed search engine, performing deep paging retrieval of resources based on the information retrieval needs, and obtaining a candidate retrieval result log; in response to identifying that the user terminal is a first-time visitor, obtaining the number of pages corresponding to the candidate retrieval result log based on the number of page display elements of the user terminal; paging the candidate retrieval result log based on the number of pages, and obtaining a target retrieval page set corresponding to the search statement, wherein the number of pages in the target retrieval page set is the same as the number of pages.
[0011] According to an embodiment of the present disclosure, in response to identifying that a user terminal is a first-time visitor, the number of pages corresponding to the candidate retrieval result log is obtained based on the number of page display elements of the user terminal, including: in response to identifying that the user terminal is a first-time visitor, the number of retrieval results in the candidate retrieval result log is obtained; based on the number of retrieval results and the number of page display elements, the number of pages corresponding to the candidate retrieval result log is obtained.
[0012] According to an embodiment of the present disclosure, the method further includes: in response to identifying that the user terminal is not a first-time access user terminal, obtaining a request parameter of the user terminal, and obtaining a page number of the user terminal from the request parameter.
[0013] According to an embodiment of the present disclosure, the candidate search result log is paginated based on the number of pages to obtain a target search page set corresponding to the search statement, wherein the number of pages in the target search page set is the same as the number of pages, including: constructing a candidate search page set to be filled based on the number of pages, wherein the number of pages in the candidate search page set is the same as the number of pages; obtaining the first target search result located at the first position and the second target search results located at the non-first position in each candidate search page from the candidate search result log based on the number of page display elements; filling each candidate search page based on the first target search result and the second target search results to obtain each target search page; and obtaining a target search page set for the search statement based on each target search page.
[0014] According to one embodiment of the present disclosure, each candidate search page is filled based on the first target search result and each second target search result to obtain each target search page, including: for any candidate search page, obtaining a blank search result sequence of the candidate search page; obtaining a first filling position of the first target search result in the blank search result sequence, and each second filling position of each second target search result in the blank search result sequence; filling the first target search result into the blank search result sequence based on the first filling position, and filling each second target search result into the blank search result sequence based on the second filling position, to obtain a filled target search result sequence; updating the candidate search page according to the target search result sequence to obtain a target search page.
[0015] According to an embodiment of the present disclosure, a search statement input by a user terminal is obtained, and the information retrieval requirement of the user terminal is obtained based on the search statement, including: obtaining a preset sentence parsing algorithm; parsing the search statement based on the sentence parsing algorithm to obtain parsing information of the search statement, and obtaining the information retrieval requirement of the user terminal based on the parsing information.
[0016] According to an embodiment of the present disclosure, the engine capability of a distributed search engine is called to perform a deep paged search of resources based on information retrieval requirements to obtain a candidate retrieval result log, including: obtaining a retrieval keyword based on the information retrieval requirement, and performing a deep paged search of resources based on the retrieval keyword through the engine capability of the distributed search engine to obtain an initial retrieval result log output by the distributed search engine; and sorting each initial retrieval result in the initial retrieval result log to obtain a sorted candidate retrieval result log.
[0017] According to an embodiment of the present disclosure, each initial search result in the initial search result log is sorted to obtain a sorted candidate search result log, including:
[0018] The retrieval time and log line number of each initial retrieval result in the initial retrieval result log are obtained; the initial retrieval results are sorted according to the retrieval time and log line number to obtain a candidate retrieval result log.
[0019] According to one embodiment of the present disclosure, before obtaining the number of pages corresponding to the candidate retrieval result log, it also includes: identifying whether the user end has triggered the start condition of the paging plug-in; in response to identifying that the user end has triggered the start condition of the paging plug-in, starting the paging plug-in, and obtaining the number of pages through the paging plug-in to paginate the candidate retrieval result log to obtain a target retrieval page set.
[0020] To achieve the above-mentioned purpose, the second party of the present disclosure proposes an information retrieval device, including: a first acquisition module, used to obtain a search statement input by a user terminal, and obtain the information retrieval needs of the user terminal based on the search statement; a second acquisition module, used to call the engine capabilities of a distributed search engine, perform deep paging retrieval of resources based on information retrieval needs, and obtain a candidate retrieval result log; a third acquisition module, used to respond to identifying that the user terminal is a first-time visitor, and obtain the number of pages corresponding to the candidate retrieval result log according to the number of page display elements of the user terminal; a paging module, used to paginate the candidate retrieval result log based on the number of pages, and obtain a target retrieval page set corresponding to the retrieval statement, wherein the number of pages in the target retrieval page set is the same as the number of pages.
[0021] According to one embodiment of the present disclosure, the third acquisition module is also used to: in response to identifying that the user terminal is a first-time user terminal, obtain the number of retrieval results in the candidate retrieval result log; based on the number of retrieval results and the number of page display elements, obtain the number of pages corresponding to the candidate retrieval result log.
[0022] According to an embodiment of the present disclosure, the third acquisition module is further used to: in response to identifying that the user terminal is not a first-time access user terminal, acquire the request parameters of the user terminal, and acquire the number of pages of the user terminal from the request parameters.
[0023] According to one embodiment of the present disclosure, the paging module is also used to: construct a set of candidate retrieval pages to be filled according to the number of pages, wherein the number of pages in the candidate retrieval page set is the same as the number of pages; obtain the first target retrieval result located in the first position and the second target retrieval results located in the non-first position in each candidate retrieval page from the candidate retrieval result log according to the number of page display elements; fill each candidate retrieval page based on the first target retrieval result and the second target retrieval results to obtain each target retrieval page; and obtain a target retrieval page set of the retrieval statement based on each target retrieval page.
[0024] According to one embodiment of the present disclosure, the paging module is also used to: for any candidate retrieval page, obtain a blank retrieval result sequence of the candidate retrieval page; obtain a first filling position of the first target retrieval result in the blank retrieval result sequence, and each second filling position of each second target retrieval result in the blank retrieval result sequence; fill the first target retrieval result into the blank retrieval result sequence based on the first filling position, and fill each second target retrieval result into the blank retrieval result sequence based on each second filling position, to obtain a filled target retrieval result sequence; update the candidate retrieval page according to the target retrieval result sequence to obtain a target retrieval page.
[0025] According to an embodiment of the present disclosure, the first acquisition module is further used to: acquire a preset sentence parsing algorithm; parse the search sentence based on the sentence parsing algorithm to obtain parsing information of the search sentence, and acquire the information retrieval requirement of the user terminal according to the parsing information.
[0026] According to one embodiment of the present disclosure, the second acquisition module is also used to: obtain retrieval keywords based on information retrieval requirements, and perform deep paged retrieval of resources based on the retrieval keywords through the engine capabilities of the distributed search engine to obtain an initial retrieval result log output by the distributed search engine; sort each initial retrieval result in the initial retrieval result log to obtain a sorted candidate retrieval result log.
[0027] According to one embodiment of the present disclosure, the second acquisition module is further used to: obtain the retrieval time and log line number of each initial retrieval result in the initial retrieval result log; sort the initial retrieval results according to the retrieval time and log line number to obtain a candidate retrieval result log.
[0028] According to one embodiment of the present disclosure, before obtaining the number of pages corresponding to the candidate retrieval result log, it also includes a trigger module for: identifying whether the user end has triggered the start condition of the paging plug-in; in response to identifying that the user end has triggered the start condition of the paging plug-in, starting the paging plug-in, and obtaining the number of pages through the paging plug-in to paginate the candidate retrieval result log to obtain a target retrieval page set.
[0029] To achieve the above-mentioned purpose, the third aspect of the present disclosure proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to implement the information retrieval method as described in the first aspect of the present disclosure.
[0030] To achieve the above-mentioned purpose, the fourth aspect of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to implement the information retrieval method as described in the first aspect of the present disclosure.
[0031] To achieve the above-mentioned objective, the fifth aspect of the present disclosure proposes a computer program product, including a computer program, which is used to implement the information retrieval method as described in the first aspect of the present disclosure when executed by a processor.
[0032] The information retrieval method and device proposed in the present disclosure obtain the information retrieval requirements in the retrieval statement, and obtain the corresponding candidate retrieval result log according to the information retrieval requirements, and then paginate the candidate retrieval result log according to the corresponding number of pages, so as to obtain the target retrieval page set of the retrieval statement. In the present disclosure, the candidate retrieval result log is paginated according to the number of pages to obtain the target retrieval page set. Compared with the retrieval results obtained by scrolling query in the related art, the abnormal situation that the updated index data cannot be reflected in the retrieval results in the scenario of index data update is avoided, and the situation that the time required for scrolling query affects the real-time performance of the retrieval results is avoided, and the timeliness and real-time performance of the retrieval results are optimized. The retrieval results can be displayed on the user side in the form of paging, realizing the paginated display of the retrieval results and the page jump view of the retrieval results, improving the degree of adaptation between the display form of the retrieval results and the user's reading habits, and optimizing the retrieval experience of the user side. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 A flowchart of an information retrieval method according to an embodiment of the present disclosure;
[0034] Figure 2 is a schematic diagram of an information retrieval method according to another embodiment of the present disclosure;
[0035] Figure 3 is a schematic diagram of an information retrieval method according to another embodiment of the present disclosure;
[0036] Figure 4 is a schematic diagram of an information retrieval device according to an embodiment of the present disclosure;
[0037] Figure 5FIG. 4 is a schematic diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0038] Embodiments of the present disclosure are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.
[0039] It should be noted that the acquisition, storage, use, and processing of data in the technical solution disclosed in this disclosure are in compliance with the relevant provisions of laws and regulations.
[0040] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this disclosure are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards.
[0041] It should be noted that in the embodiments of the present disclosure, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be considered as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present disclosure, but it does not mean that the applicant has or will necessarily use the solution.
[0042] Figure 1 FIG. 1 is a flow chart of an information retrieval method according to an embodiment of the present disclosure. Figure 1 As shown, the method includes:
[0043] S101, obtaining a search sentence input by a user, and obtaining the information search requirement of the user according to the search sentence.
[0044] In the disclosed embodiment, a sentence input by the user terminal carrying the user's search requirement can be marked as a search sentence input by the user terminal. The user's search requirement can be parsed through the search sentence input by the user terminal, thereby returning the search result required by the user terminal.
[0045] Optionally, an information extraction algorithm in the related art may be obtained, and the search statement may be algorithmically processed based on the algorithm, and the search requirements of the user end extracted from the search statement according to the result of the algorithm processing may be marked as information retrieval requirements.
[0046] It should be noted that the user terminal may input the search statement in the form of text or voice, and no specific limitation is made here.
[0047] S102, calling the engine capability of the distributed search engine, performing deep paged search of resources based on information retrieval requirements, and obtaining a candidate search result log.
[0048] In the disclosed embodiment, after obtaining the information retrieval requirements of the user terminal, resources can be retrieved based on the obtained information retrieval requirements by calling a preset search engine, and a log consisting of retrieval results obtained by the search engine based on the information retrieval requirements can be marked as a candidate retrieval result log.
[0049] Optionally, a distributed search engine can be called based on the search engine calling method in the relevant technology, and resource retrieval can be performed based on information retrieval needs through the engine capabilities of the distributed search engine, wherein a search keyword can be obtained according to the information retrieval needs, and a deep paged search of resources can be performed based on the search keyword to obtain multiple search results, and the log consisting of the multiple search results can be marked as a candidate search result log.
[0050] The distributed search engine may be an Elasticsearch search engine or any other type of distributed search engine, which is not specifically limited here.
[0051] As an example, the distributed search engine is set to the Elasticsearch search engine. In this example, the Elasticsearch search engine can be called based on the calling method related to the Elasticsearch search engine, and network resources can be retrieved based on the information retrieval system through the engine capabilities of the Elasticsearch search engine to obtain the candidate retrieval result log corresponding to the information retrieval requirements.
[0052] S103, in response to identifying that the user terminal is a first-time access user terminal, obtaining the number of pages corresponding to the candidate search result log according to the number of page display elements of the user terminal.
[0053] In the disclosed embodiment, the candidate search result log may be understood as an information record list consisting of the candidate search results. In this scenario, the candidate search results recorded in the candidate search result log may not be adapted to the user's reading habits.
[0054] Optionally, the candidate search result log may be paged to divide each acquired candidate search result into multiple search result pages, wherein the number of pages limited when the candidate search result log is paged may be marked as the number of pages of the candidate search result log.
[0055] It can be understood that, through the number of pages, the quantity condition that the candidate search result log needs to follow when performing search result paging can be determined, and the paging processing of the candidate search result log can be implemented based on the condition.
[0056] In the disclosed embodiment, the user terminal may be a user terminal in a scenario of first-time access to the server, or may be a user terminal in a scenario of non-first-time access to the server. The strategies for obtaining the number of pages for the user terminals in different access scenarios are different.
[0057] In this scenario, the request parameters for the user's server access can be obtained, and based on the corresponding identification code in the request parameters, it can be identified whether the user is accessing the server for the first time. Furthermore, when it is identified that the user is accessing the server for the first time, it is necessary to obtain relevant information of the user, and determine the number of pages of the candidate retrieval result log corresponding to the user based on the relevant information of the user.
[0058] Optionally, relevant parameters of the display area for the search results provided by the user terminal accessing the server for the first time may be obtained, and the number of pages corresponding to the candidate search result log may be determined according to the relevant parameters of the display area.
[0059] Among them, the display area provided by the user terminal for the search results has a set display area, based on which the number of search results that can be displayed on the display page of the user terminal can be determined, wherein the number can be marked as the number of page display elements corresponding to the user terminal.
[0060] In this scenario, the number of pages of the candidate search result log can be determined based on the number of elements displayed on the page.
[0061] Optionally, the server may also determine the corresponding number of pages based on the relevant information of the candidate search results in the candidate search result log, which is not specifically limited here.
[0062] S104, paging the candidate search result log based on the paging number to obtain a target search page set corresponding to the search statement, wherein the number of pages in the target search page set is the same as the paging number.
[0063] In an embodiment of the present disclosure, the candidate search result log can be paged based on the obtained number of pages to obtain multiple search pages after page processing. The search page can be marked as the target search page corresponding to the search statement, wherein the number of pages of the multiple target search pages is the same as the number of pages.
[0064] Furthermore, based on the multiple target search pages obtained after the paging process, a target search page set of the search statement is composed and returned to the user end for display.
[0065] As an example, each candidate search result in the candidate search result log may be divided based on the number of pages to obtain a plurality of search result subsets after division, wherein each candidate search result included in each subset is displayed on the same page.
[0066] Furthermore, based on the page generation method in the related art, page generation processing is performed on the multiple search result subsets obtained by division, so as to obtain the search result pages of the multiple search result subsets respectively as the target search pages of the search statement, thereby obtaining a target search page set consisting of multiple target search pages.
[0067] The information retrieval method proposed in the present disclosure obtains the information retrieval requirements in the search statement, and obtains the corresponding candidate search result log according to the information retrieval requirements, and then paginates the candidate search result log according to the corresponding number of pages, so as to obtain the target search page set of the search statement. In the present disclosure, the candidate search result log is paginated according to the number of pages to obtain the target search page set. Compared with the related art of obtaining the search results by scrolling query, the abnormal situation that the updated index data cannot be reflected in the search results in the scenario of index data update is avoided, and the situation that the time required for scrolling query affects the real-time performance of the search results is avoided, and the timeliness and real-time performance of the search results are optimized. The search results can be displayed on the user side in the form of paging, realizing the paginated display of the search results and the page jump view of the search results, improving the degree of adaptation between the display form of the search results and the user's reading habits, and optimizing the search experience of the user side.
[0068] In the above embodiment, the acquisition of the target search page set can be combined with Figure 2 Further understanding, Figure 2 FIG. 1 is a flow chart of an information retrieval method according to another embodiment of the present disclosure. Figure 2 As shown, the method includes:
[0069] S201, obtaining a search sentence input by a user, and obtaining the information search requirement of the user according to the search sentence.
[0070] Optionally, a preset sentence parsing algorithm is obtained, and the search sentence is parsed based on the sentence parsing algorithm to obtain parsing information of the search sentence, and the information retrieval requirement of the user terminal is obtained according to the parsing information.
[0071] In the embodiments of the present disclosure, a corresponding sentence parsing algorithm can be obtained based on the form of the search sentence input by the user terminal. When the user terminal inputs the search sentence in text form, a text information parsing algorithm in the related technology can be obtained as the sentence parsing algorithm for the search sentence. When the user terminal inputs the search sentence in audio form, an audio information parsing algorithm in the related technology can be obtained as the sentence parsing algorithm for the search sentence. No specific limitation is made here.
[0072] Optionally, the search sentence may be parsed based on a sentence parsing algorithm to extract the search information carried in the search sentence, and the parsed information may be marked as parsed information of the search sentence.
[0073] Furthermore, by parsing the information, a specific search requirement carried in the search sentence is obtained and marked as the information search requirement input by the user end, so as to achieve accurate extraction of the information search requirement carried in the search sentence.
[0074] Among them, the search statement can be semantically analyzed based on the sentence analysis algorithm, and then the information retrieval requirements in the search statement are obtained according to the analysis information obtained by the semantic analysis. The search statement can also be searched for keywords extracted based on the semantic analysis algorithm, and then the information retrieval requirements in the search statement are obtained according to the extracted search keywords. No specific limitation is made here.
[0075] S202, obtaining a search keyword based on the information retrieval requirement, and performing a deep paged search of resources based on the search keyword through the engine capability of the distributed search engine, to obtain an initial search result log output by the distributed search engine.
[0076] In the disclosed embodiment, a distributed search engine may be called based on a search engine calling method in related technologies, and then a deep paged search may be performed based on information retrieval requirements through the engine capabilities of the called distributed search engine, thereby obtaining multiple search results retrieved by the distributed search engine, wherein a log consisting of the multiple search results is the initial search result log obtained by the distributed search engine.
[0077] Optionally, the information retrieval requirements can be algorithmically processed based on the keyword extraction algorithm in the relevant technology, and then the relevant fields that can be used as keywords in the information retrieval requirements are obtained according to the results of the algorithm processing, and these fields are marked as search keywords in the information retrieval requirements.
[0078] In this scenario, the engine capability of the distributed search engine can be used to perform deep paged retrieval of resources based on the search keyword, thereby obtaining the corresponding initial search result log.
[0079] As an example, a call is set to the distributed search engine Elasticsearch search engine, wherein the search keywords obtained based on the information retrieval requirements can be input into the demand receiving port of the Elasticsearch search engine, and the Elasticsearch search engine performs resource retrieval based on the search keywords received, thereby obtaining an initial search result log consisting of multiple search results.
[0080] S203, sorting the initial search results in the initial search result log to obtain a sorted candidate search result log.
[0081] Optionally, the retrieval time and log line number of each initial retrieval result in the initial retrieval result log are obtained, and the initial retrieval results are sorted according to the retrieval time and log line number to obtain a candidate retrieval result log.
[0082] In an embodiment of the present disclosure, each initial search result included in the initial search result log has its own attribute information, wherein the attribute information may include the time when each initial search result is retrieved, and the time can be marked as the retrieval time, and the attribute information may also include the line number corresponding to the position of any initial search result in the entire initial search result log, and the line number can be marked as the log line number of the initial search result.
[0083] In this scenario, each initial search result can be sorted based on the retrieval time and log line number of each initial search result. Among them, each initial search result can be sorted in the time dimension based on the retrieval time in order from early to late. In the process of sorting based on the retrieval time, there may be a situation where multiple initial search results have the same retrieval time. In this scenario, for multiple initial search results with the same retrieval time, they can be sorted in order from small to large based on the log line number.
[0084] Furthermore, the initial search results are sorted based on the search time and the log line number, and the record log composed of the sorted search results is marked as a candidate search result log, thereby obtaining multiple candidate search results that are adapted to the information retrieval requirements in the search statement input by the user.
[0085] S204, in response to identifying that the user terminal is a first-time access user terminal, obtaining the number of pages corresponding to the candidate search result log according to the number of page display elements of the user terminal.
[0086] Optionally, in response to identifying that the user terminal is a first-time access user terminal, the number of search results in the candidate search result log is obtained, and the number of pages corresponding to the candidate search result log is obtained according to the number of search results and the number of page display elements.
[0087] In the embodiment of the present disclosure, the user terminal may be a user terminal visiting for the first time, or may be a user terminal not visiting for the first time. When the server recognizes that the user terminal currently inputting the search statement is a user terminal visiting for the first time, the corresponding number of pages can be determined based on the number of page display elements of the user terminal.
[0088] As a possible implementation method, the number of search results of each candidate search result in the candidate search result log can be used as the dividend, and the number of page display elements on the user side can be used as the divisor to obtain the quotient of the two, where the quotient can be determined as the number of pages corresponding to the candidate search result log.
[0089] As another possible implementation method, the number of search result divisions of the candidate search result log can be determined based on the number of page display elements, and each candidate search result in the candidate search result log can be divided into sets based on the number of search result divisions, and the number of sets obtained by the division is then determined as the number of pages corresponding to the candidate search result log.
[0090] Optionally, in response to identifying that the user terminal is not a first-time access user terminal, a request parameter of the user terminal is obtained, and the number of pages of the user terminal is obtained from the request parameter.
[0091] In the disclosed embodiment, after the server determines the number of pages of the user terminal, it can put the determined number of pages into a corresponding return parameter and return the return parameter together with the target search page set to the user terminal to mark the number of pages of the user terminal.
[0092] In this scenario, when the user client sends an access request to the server again, the user client can put its marked page number into the request parameter of the server's access request. In this scenario, when the server recognizes that the currently accessing user client is not a first-time accessing user client, it can read the request parameters in the access request sent by the user client, and then read the page number of the user client from the information carried by the request parameters.
[0093] In this way, the accurate acquisition of the paging number of the candidate retrieval result log is achieved. By identifying whether the user end is a first-time user end, different paging number acquisition methods are determined, which improves the efficiency of paging number acquisition, thereby providing accurate paging execution information for subsequent paging processing of the candidate retrieval result log.
[0094] It should be noted that before obtaining the number of paging, it is also possible to identify whether the candidate retrieval result log needs to be paging processed. Here, it can be identified whether the user end has triggered the start condition of the paging plug-in. In response to identifying that the user end has triggered the start condition of the paging plug-in, the paging plug-in is started, and the number of paging is obtained through the paging plug-in to paging the candidate retrieval result log to obtain the target retrieval page set.
[0095] In the embodiment of the present disclosure, the candidate search result set may be paged by a preset plug-in, wherein the plug-in may be marked as a paging plug-in.
[0096] Before starting the paging plug-in, it is possible to identify whether the user terminal needs to display the search results in pages. In this scenario, the relevant information for the user terminal to display the search results can be obtained, and this part of information can be matched with the startup conditions of the paging plug-in. When it is identified that the information matches the startup conditions, it can be determined that the user terminal has been identified as triggering the startup conditions of the paging plug-in.
[0097] In this scenario, when it is recognized that the user end has triggered the start condition of the paging plug-in, the paging plug-in can be started, and the number of pages of the candidate retrieval result log is obtained based on the execution of the paging plug-in, and then the paging of the candidate retrieval result log is implemented based on the number of pages to obtain the target retrieval page set.
[0098] Therefore, by starting the paging plug-in, the paging processing of the candidate search result log is realized, thereby improving the efficiency of the paging processing.
[0099] S205 , constructing a candidate search page set to be filled according to the number of pages, wherein the number of pages in the candidate search page set is the same as the number of pages.
[0100] In the disclosed embodiment, a plurality of display pages to be filled can be constructed based on a preset display page construction method and marked as a plurality of candidate search pages to be filled, wherein the number of constructed candidate search pages is the same as the number of pages.
[0101] Furthermore, based on the constructed multiple candidate search pages, a candidate search page set is formed.
[0102] S206, obtaining the first target search result located at the first position in each candidate search page and each second target search result located not at the first position from the candidate search result log according to the number of page display elements.
[0103] In the disclosed embodiment, after obtaining the number of page display elements, each candidate search result in the candidate search result log may be divided based on the number to obtain a plurality of divided candidate search result log segments.
[0104] The plurality of candidate search result log segments correspond one-to-one to each candidate search page in the candidate search page set.
[0105] In this scenario, the candidate retrieval result located at the first position in any candidate retrieval result log segment can be obtained, and the candidate retrieval result is determined as the first target retrieval result located at the first position in the candidate retrieval page corresponding to the log segment.
[0106] Accordingly, the remaining non-first candidate retrieval results in the log segment except the first one can be obtained, and this part of the candidate retrieval results can be determined as the second target retrieval results that are not in the first position in the candidate retrieval page corresponding to the log segment.
[0107] S207: Fill each candidate search page based on the first target search result and each second target search result to obtain each target search page.
[0108] In the disclosed embodiment, for any candidate search page, the first target search result and each second target search result of the candidate search page can be filled into the candidate search page, and the filled page is determined as the target search page of the candidate search page.
[0109] Among them, for any candidate search page, a blank search result sequence of the candidate search page is obtained, a first filling position of the first target search result in the blank search result sequence, and each second filling position of each second target search result in the blank search result sequence are obtained.
[0110] In the disclosed embodiment, for any candidate search page, a blank sequence in a display area provided on the candidate search page for displaying search results may be marked as a blank search result sequence of the candidate search page.
[0111] In this scenario, the first target search result and each second target search result of the candidate search page may be filled into the blank search result sequence, thereby obtaining a corresponding target search page.
[0112] The filling position of the first target search result in the blank search result sequence may be marked as a first filling position, and the first filling position is the first filling position in the blank search result sequence.
[0113] Correspondingly, for any second target retrieval result, the ranking position of the second target retrieval result in all the second target retrieval results can be obtained, and the filling position at the same ranking position in the blank retrieval result sequence can be determined as the second filling position of the second target retrieval result, thereby obtaining the second filling positions of each second target retrieval result.
[0114] Optionally, the first target search result is filled into the blank search result sequence based on the first filling position, and each second target search result is filled into the blank search result sequence based on each second filling position to obtain a filled target search result sequence.
[0115] In the disclosed embodiment, for any candidate search page, the index information of the first target search result can be filled into the corresponding first filling position based on a preset search result filling method, and the index information of any second target search result can be filled into its corresponding second filling position, until the blank search result sequence on the candidate search page is filled, thereby obtaining a filled search result sequence.
[0116] The filled retrieval result sequence may be marked as a target retrieval result sequence.
[0117] Optionally, the candidate search pages are updated according to the target search result sequence to obtain the target search page.
[0118] In an embodiment of the present disclosure, for any candidate search page, after obtaining a target search result sequence after filling a blank search result sequence of the candidate search page, the candidate search page can be updated based on the target search result sequence, wherein the target search result sequence can be overwritten to the position of the blank search result sequence, thereby realizing the update of the candidate search page based on the target search result sequence, and determining the page obtained after the update as the target search page.
[0119] S208: Based on each target search page, a target search page set of the search statement is obtained.
[0120] Optionally, based on a set construction method in related art, a set construction process may be performed on each target search page, and then a target search page set consisting of each target search page may be obtained according to the result of the construction process.
[0121] Furthermore, the acquired target search page set can be returned to the client that inputs the search statement, and the search results can be displayed in pages in the display area provided by the client.
[0122] The information retrieval method proposed in the present invention marks the number of pages on the user side, shortens the time for obtaining the number of pages for users who are not visiting for the first time, improves the paging efficiency of candidate retrieval results, and paginates the candidate retrieval result log according to the number of pages to obtain a target retrieval page set. Compared with the related art of obtaining retrieval results by scrolling query, it avoids the occurrence of abnormal situations in which the updated index data cannot be reflected in the retrieval results in the scenario of index data update, and avoids the situation in which the time required for scrolling query affects the real-time performance of the retrieval results, optimizes the timeliness and real-time performance of the retrieval results, and the retrieval results can be displayed on the user side in a paginated form, thereby realizing the paginated display of the retrieval results and the page jump view of the retrieval results, improving the degree of adaptation between the display form of the retrieval results and the user's reading habits, and optimizing the retrieval experience of the user side.
[0123] To better understand the above embodiments, Figure 3 , Figure 3 FIG. 1 is a flow chart of an information retrieval method according to another embodiment of the present disclosure. Figure 3 As shown:
[0124] Enter the search statement through the module accessed by the user Figure 3 The server shown in Figure 3 In the illustrated scenario, the server can identify whether the user terminal that inputs the search statement is a first-time user terminal.
[0125] like Figure 3 As shown, when the user terminal is identified as a first-time user terminal, the number of pages corresponding to the user terminal can be determined based on the method for obtaining the number of pages proposed in the above embodiment, and the number of pages corresponding to the user terminal can be determined based on the number of pages. Figure 3 The candidate search result log obtained by the distributed search engine 1 shown in the figure is paginated to obtain Figure 3 The target search page set shown is returned to the user end.
[0126] like Figure 3 As shown, the server may also put the page number of the first-time access client into a corresponding return parameter and return it to the client to mark the page number of the client.
[0127] like Figure 3 As shown, when the client is identified as a non-first-time access client, the number of pages of the client marked by the server in the past can be obtained from the request parameters sent by the client, and the server can query the page number based on the page number. Figure 3 The candidate search result logs obtained by the distributed search engine 2 are paginated to obtain a target search page set returned to the user end.
[0128] The information retrieval method proposed in the present invention marks the number of pages on the user side, shortens the time for obtaining the number of pages for users who are not visiting for the first time, improves the paging efficiency of candidate retrieval results, and paginates the candidate retrieval result log according to the number of pages to obtain a target retrieval page set. Compared with the related art of obtaining retrieval results by scrolling query, it avoids the occurrence of abnormal situations in which the updated index data cannot be reflected in the retrieval results in the scenario of index data update, and avoids the situation in which the time required for scrolling query affects the real-time performance of the retrieval results, optimizes the timeliness and real-time performance of the retrieval results, and the retrieval results can be displayed on the user side in a paginated form, thereby realizing the paginated display of the retrieval results and the page jump view of the retrieval results, improving the degree of adaptation between the display form of the retrieval results and the user's reading habits, and optimizing the retrieval experience of the user side.
[0129] Corresponding to the information retrieval methods provided in the above-mentioned embodiments, an embodiment of the present disclosure further provides an information retrieval device. Since the information retrieval device provided in the embodiment of the present disclosure corresponds to the information retrieval methods provided in the above-mentioned embodiments, the implementation methods of the above-mentioned information retrieval methods are also applicable to the information retrieval device provided in the embodiment of the present disclosure and will not be described in detail in the following embodiments.
[0130] Figure 4 is a schematic diagram of an information retrieval device according to an embodiment of the present disclosure, Figure 4 As shown, the information retrieval device 400 includes a first acquisition module 41, a second acquisition module 42, a third acquisition module 43 and a paging module 44, wherein:
[0131] The first acquisition module 41 is used to acquire a search statement input by a user terminal, and acquire the information retrieval requirement of the user terminal according to the search statement;
[0132] The second acquisition module 42 is used to call the engine capability of the distributed search engine, perform deep paged search of resources based on information retrieval requirements, and obtain candidate search result logs;
[0133] The third acquisition module 43 is used to obtain the number of pages corresponding to the candidate search result log according to the number of page display elements of the user terminal in response to identifying that the user terminal is a first-time visitor;
[0134] The paging module 44 is used to paginate the candidate search result log based on the paging number to obtain a target search page set corresponding to the search statement, wherein the number of pages in the target search page set is the same as the paging number.
[0135] In the embodiment of the present disclosure, the third acquisition module 43 is also used to: in response to identifying that the user terminal is a first-time user terminal, obtain the number of retrieval results in the candidate retrieval result log; based on the number of retrieval results and the number of page display elements, obtain the number of pages corresponding to the candidate retrieval result log.
[0136] In the embodiment of the present disclosure, the third acquisition module 43 is further used to: in response to identifying that the user terminal is not a first-time access user terminal, acquire the request parameters of the user terminal, and acquire the number of pages of the user terminal from the request parameters.
[0137] In the disclosed embodiment, the paging module 44 is further used to: construct a set of candidate search pages to be filled according to the number of pages, wherein the number of pages in the candidate search page set is the same as the number of pages; obtain the first target search result located in the first position and the second target search results located in the non-first position in each candidate search page from the candidate search result log according to the number of page display elements; fill each candidate search page based on the first target search result and the second target search results to obtain each target search page; and obtain a set of target search pages for the search statement based on each target search page.
[0138] In the disclosed embodiment, the paging module 44 is also used to: for any candidate search page, obtain a blank search result sequence of the candidate search page; obtain a first filling position of the first target search result in the blank search result sequence, and each second filling position of each second target search result in the blank search result sequence; fill the first target search result into the blank search result sequence based on the first filling position, and fill each second target search result into the blank search result sequence based on each second filling position, to obtain a filled target search result sequence; update the candidate search page according to the target search result sequence to obtain a target search page.
[0139] In the disclosed embodiment, the first acquisition module 41 is further used to: acquire a preset sentence parsing algorithm; parse the search sentence based on the sentence parsing algorithm to obtain parsing information of the search sentence, and acquire the information retrieval requirement of the user terminal according to the parsing information.
[0140] In the disclosed embodiment, the second acquisition module 42 is also used to: obtain search keywords based on information retrieval requirements, and perform deep paged search of resources based on the search keywords through the engine capabilities of the distributed search engine to obtain an initial search result log output by the distributed search engine; sort each initial search result in the initial search result log to obtain a sorted candidate search result log.
[0141] In the disclosed embodiment, the second acquisition module 42 is further used to: obtain the retrieval time and log line number of each initial retrieval result in the initial retrieval result log; sort each initial retrieval result according to the retrieval time and log line number to obtain a candidate retrieval result log.
[0142] In the embodiment of the present disclosure, before obtaining the number of pages corresponding to the candidate retrieval result log, it also includes a trigger module for: identifying whether the user end has triggered the start condition of the paging plug-in; in response to identifying that the user end has triggered the start condition of the paging plug-in, starting the paging plug-in, and obtaining the number of pages through the paging plug-in to paginate the candidate retrieval result log to obtain a target retrieval page set.
[0143] The information retrieval device proposed in the present disclosure obtains the information retrieval requirements in the search statement, and obtains the corresponding candidate search result log according to the information retrieval requirements, and then paginates the candidate search result log according to the corresponding number of pages, so as to obtain the target search page set of the search statement. In the present disclosure, the candidate search result log is paginated according to the number of pages to obtain the target search page set. Compared with the related art of obtaining the search results by scrolling query, the abnormal situation that the updated index data cannot be reflected in the search results in the scenario of index data update is avoided, and the situation that the time required for scrolling query affects the real-time performance of the search results is avoided, and the timeliness and real-time performance of the search results are optimized. The search results can be displayed on the user side in the form of paging, realizing the paginated display of the search results and the page jump view of the search results, improving the degree of adaptation between the display form of the search results and the user's reading habits, and optimizing the search experience of the user side.
[0144] In order to implement the above embodiment, the present disclosure also provides an electronic device 500, such as Figure 5 As shown, the electronic device 500 includes: a processor 51 and a memory 52 that is communicatively connected to the processor, the memory 52 stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor 51 to implement the above Figures 1 to 3 The information retrieval method proposed in the embodiment.
[0145] In order to implement the above embodiment, the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to implement the above embodiment. Figures 1 to 3 The information retrieval method proposed in the embodiment.
[0146] In order to implement the above embodiments, the present disclosure also provides a computer program product, including a computer program, which implements the above embodiments when executed by a processor. Figures 1 to 3 The information retrieval method proposed in the embodiment.
[0147] In the description of the present disclosure, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present disclosure and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present disclosure.
[0148] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present disclosure, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0149] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0150] Although the embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present disclosure. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present disclosure.
Claims
1. An information retrieval method, characterized in that: The method comprises: Obtaining a search statement input by a user, and obtaining the information retrieval requirement of the user according to the search statement; Invoke the engine capability of the distributed search engine, perform deep paged search of resources based on the information retrieval requirements, and obtain a candidate search result log; In response to identifying that the user terminal is a first-time user terminal, obtaining the number of pages corresponding to the candidate search result log according to the number of page display elements of the user terminal; The candidate search result log is paginated based on the paging quantity to obtain a target search page set corresponding to the search statement, wherein the number of pages in the target search page set is the same as the paging quantity.
2. The method according to claim 1, characterized in that In response to identifying that the user terminal is a first-time user terminal, obtaining the number of pages corresponding to the candidate search result log according to the number of page display elements of the user terminal, including: In response to identifying that the user terminal is a first-time user terminal, obtaining the number of search results in the candidate search result log; The number of pages corresponding to the candidate search result log is obtained according to the number of search results and the number of page display elements.
3. The method according to claim 1, characterized in that The method further comprises: In response to identifying that the client is not a first-time access client, a request parameter of the client is obtained, and the number of pages of the client is obtained from the request parameter.
4. The method according to claim 1, characterized in that: The step of paging the candidate search result log based on the paging quantity to obtain a target search page set corresponding to the search statement, wherein the number of pages in the target search page set is the same as the paging quantity, comprises: According to the number of pages, a candidate search page set to be filled is constructed, wherein the number of pages in the candidate search page set is the same as the number of pages; According to the number of page display elements, obtaining the first target search result located at the first position in each candidate search page and each second target search result located at a non-first position from the candidate search result log; Fill each candidate search page based on the first target search result and each second target search result to obtain each target search page; Based on each target search page, the target search page set of the search statement is obtained.
5. The method according to claim 4, characterized in that The step of filling each candidate search page based on the first target search result and each second target search result to obtain each target search page includes: For any candidate search page, obtaining a blank search result sequence of the candidate search page; Acquire a first filling position of the first target search result in the blank search result sequence, and each second filling position of each second target search result in the blank search result sequence; Filling the first target search result into the blank search result sequence based on the first filling position, and filling each second target search result into the blank search result sequence based on each second filling position, to obtain a filled target search result sequence; The candidate search pages are updated according to the target search result sequence to obtain a target search page.
6. The method according to claim 1, characterized in that The obtaining of a search statement input by a user terminal and obtaining the information retrieval requirement of the user terminal according to the search statement includes: Get the preset statement parsing algorithm; The search sentence is parsed based on the sentence parsing algorithm to obtain parsing information of the search sentence, and the information retrieval requirement of the user terminal is obtained according to the parsing information.
7. The method according to claim 1, characterized in that The calling of the engine capability of the distributed search engine to perform deep paging retrieval of resources based on the information retrieval requirements to obtain a candidate retrieval result log includes: Obtaining a search keyword based on the information retrieval requirement, and performing a deep paged search of resources based on the search keyword through the engine capability of the distributed search engine to obtain an initial search result log output by the distributed search engine; The initial search results in the initial search result log are sorted to obtain the sorted candidate search result log.
8. The method according to claim 7, characterized in that The step of sorting the initial search results in the initial search result log to obtain the sorted candidate search result log includes: Obtaining the retrieval time and log line number of each initial retrieval result in the initial retrieval result log; The initial search results are sorted according to the search time and the log line number to obtain the candidate search result log.
9. The method according to claim 1, characterized in that: Before obtaining the number of pages corresponding to the candidate search result log, the method further includes: Identify whether the user terminal triggers the start condition of the paging plug-in; In response to identifying that the user terminal has triggered the start condition of the paging plug-in, the paging plug-in is started, and the paging number is obtained through the paging plug-in to paginate the candidate search result log to obtain the target search page set.
10. An information retrieval device, characterized in that: The device comprises: A first acquisition module, used to acquire a search statement input by a user terminal, and acquire the information retrieval requirement of the user terminal according to the search statement; The second acquisition module is used to call the engine capability of the distributed search engine, perform deep paged retrieval of resources based on the information retrieval requirements, and obtain a candidate retrieval result log; A third acquisition module is used for, in response to identifying that the user terminal is a first-time user terminal, acquiring the number of pages corresponding to the candidate search result log according to the number of page display elements of the user terminal; The paging module is used to paginate the candidate search result log based on the paging quantity to obtain a target search page set corresponding to the search statement, wherein the number of pages in the target search page set is the same as the paging quantity.
11. An electronic device, characterized in that: Including memory and processor; The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 9 when executed by a processor.
13. A computer program product, characterized in that The invention comprises a computer program for implementing the method as claimed in any one of claims 1 to 9 when the computer program is executed by a processor.