[0048] The present invention will be described in detail below with reference to specific embodiments. The following examples will help those skilled in the art to further understand the present invention, but do not limit the present invention in any form. It should be noted that, for those skilled in the art, several changes and improvements can be made without departing from the inventive concept. These all belong to the protection scope of the present invention.
[0049] like figure 1 As shown, a fast classification and aggregation method for comprehensive retrieval of e-commerce provided by the present invention involves two full-text indexes, including: a resource index and a brand index.
[0050] Steps for establishing a resource index: establish a resource index 101 to store information on all resources to be sold. The resource index is composed of resource index documents 102. Each resource index document 102 contains all the information of a resource to be sold. A document is a JSON string.
[0051] Steps for establishing a brand index: establish a brand index 103 to store the information of all brands. The brand index is composed of a brand index document 104. Each brand index document 104 contains its own information of a brand, and includes the information of each brand. Class and subclass, type priority and grade priority.
[0052] like figure 2 As shown in the figure, taking the origin as an example, the conditional reverse check steps for resources include:
[0053] Step 201: Use the aggregation function of the ElasticSearch search engine to aggregate qualified warehouses and origin codes from the resource index; this step mainly sorts out all the origin codes that have appeared from the resources that meet the search results.
[0054] Step 202: In the warehouse and origin codes aggregated in step 201, sub-aggregation is used to aggregate the qualified origin names from the resource index. This step mainly sorts out all the names of origin that have appeared from the resources that match the search results, but since each aggregation is a sub-aggregation of step 201, only one name of origin is obtained for each aggregation, which not only realizes the name of origin and The matching of the origin code improves the query efficiency. The number of results aggregated in step 201 indicates how many times this step will be executed.
[0055]Step 203 : Use sub-aggregation in the warehouse and origin codes aggregated in step 201 to aggregate the weight of resources available for purchase under each origin from the resource index. The number of results aggregated in step 201 indicates how many times this step will be executed. The resource aggregation name is returned to step 201, so that the aggregation results can be sorted according to the weight of the resources available for purchase.
[0056] Step 204: Use sub-aggregation to aggregate the number of resources under each origin from the resource index in the warehouse and origin codes aggregated in step 201. The number of results aggregated in step 201 indicates how many times this step will be executed.
[0057] Taking the place of origin as an example, the query statement for querying the relevant information of the place of origin and warehouse is as follows:
[0058] {"aggs":{"agg-manufactureCode":{
[0059] "terms":{"field":"manufactureCode","size":50,
[0060] "order":{"manufactureWeight":"desc"}
[0061]}, "agg-manufactureName": {
[0062] "terms":{"field":"manufactureName","size":1
[0063]}, "manufactureWeight":{"sum":{"field":"balanceWeight"}
[0064]}, "manufactureCount":{"value_count":{"field":"resourceId"}}}}}
[0065] Among them, manufactureCode is the origin code, manufactureName is the origin name, balanceWeight is the purchasable weight, resourceId is the resource id, and agg-manufactureCode is the custom aggregation name. The aggregation uses the term aggregation to obtain the origin code, and takes the first 50 and according to the Define the result of the aggregate manufactureWeight in descending order. The aggregate is a sub-aggregation of agg-manufactureCode, which is used to obtain the weight of purchasable resources under each origin code. agg-manufactureName is another sub-aggregation of agg-manufactureCode, which is used to obtain each The corresponding origin name under the origin code, since the origin code and the origin name are in one-to-one correspondence, each agg-manufactureCode aggregation will only get one result. Similarly, the manufacturingCount aggregation is also a sub-aggregation of manufacturingCode, which is used to obtain the number of resources under each origin code.
[0066] like image 3 As shown, the conditional reverse checking steps for the brand include:
[0067] Step 301: Use the aggregation function of the ElasticSearch search engine to aggregate the qualified brand codes from the resource index, and this step mainly sorts out all the appearing brand codes from the resources that meet the search results.
[0068] Step 302 : According to the aggregated grade codes, use the aggregation function of the search engine to query the grades that meet the conditions from the grade index as a limited range for the next aggregation, and temporarily reserve the grades that have not been queried.
[0069] Step 303: According to the limited range, use the aggregation function of the ElasticSearch search engine to aggregate all the major categories of the brand from the brand index.
[0070] Step 304 : According to the aggregated grade categories, use sub-aggregation to aggregate the grade sub-categories from the grade index. Step 304 is executed as many times as the number of grade categories aggregated in step 303 .
[0071] Step 305 : According to the aggregated grade sub-categories, use sub-aggregation to aggregate corresponding grades from the grade index, and the number of executions of this step is the product of the number of results in step 303 and the number of results in step 304 .
[0072] Step 306: The minimum value of the aggregation type priority is regarded as the sub-aggregation of the major brand category and the minor category of brand respectively, and returned to the aggregation of major category and minor category of brand, and the order of the aggregation of major category and minor category of brand is limited.
[0073] Step 307: The minimum value of the priority of the aggregated grades is taken as a sub-aggregation of the grades aggregation, and returned to the grades aggregation to limit the order of the grades aggregation.
[0074] Step 308: Classify the grades not queried in step 302 into other categories.
[0075] The query statements related to the reverse check of the brand in the resource index are as follows:
[0076] {"aggs":{"agg-shopSign":{"terms":{
[0077] "field":"shopSignFilter","size":150}}}}
[0078] According to the search results of the resources, the grades of these resources are aggregated from the resource index, where shopSignFilter is the grade field, and the first 150 are taken from the aggregation results.
[0079] The relevant query statements for the reverse check of the grade index are as follows:
[0080] {"aggs":{"agg-type":{"terms":{
[0081] "field":"type","size":50,"order":{"type-level":"asc"}
[0082]}, "agg-subtype":{"terms":{"field":"subtype","size":50,
[0083] "order":{"subtype-level":"asc"}
[0084]}, "agg-finallyShopSign": {
[0085] "terms":{"field":"shopSignFilter","size":150,
[0086] "order":{"shopsign-level":"asc"}}, "shopsign-level":{
[0087] "min":{"field":"level"}}
[0088]}, "subtype-level":{"min":{"field":"typeLevel"}}
[0089]}, "type-level":{"min":{"field":"typeLevel"}}}}}
[0090] Where type is the major category of the grade, subtype is the sub-category of the grade, shopSignFilter is the grade, typeLevel is the type priority, and level is the grade priority. The agg-type aggregation is the outermost aggregation used to aggregate the first 150 results of the brand category. It has two sub-aggregations, the type-level aggregation and the agg-subtype aggregation. The type-level aggregation is used to limit the result set of the brand category. The order is sorted in ascending order of the aggregation results; agg-subtype aggregation is to take the first 150 results from the aggregated grade sub-category under the agg-type aggregation result, and there are two sub-aggregations under the agg-subtype aggregation, which are subtype-level aggregation and agg- finallyShopSign aggregation, subtype-level is used to limit the order of the result set of grade subclasses; agg-finallyShopSign aggregation obtains specific grade information under the aggregation results of grade subclasses, while there is only one sub-aggregation shopsign-level under agg-finallyShopSign aggregation It is used to limit the order of the result set for each grade.
[0091] Based on the above-mentioned rapid classification and aggregation method for comprehensive retrieval of e-commerce, the present invention also provides a rapid classification and aggregation system for comprehensive retrieval of e-commerce, including:
[0092] Resource index establishment module: establishes a resource index and stores information of all resources to be sold. The resource index is composed of resource index documents, and each resource index document contains all the information of a resource to be sold.
[0093] Brand index establishment module: establish a brand index and store the information of all brands. The brand index is composed of brand index documents, and each brand index document contains its own information of a brand.
[0094] For the conditional reverse check module of resources:
[0095] Use the aggregation function of the search engine to aggregate the qualified warehouse and origin codes from the resource index;
[0096] In the aggregated warehouses and origin codes, sub-aggregates are used to aggregate the eligible warehouses and origin names from the resource index, the weight of resources available for purchase in each origin, and the number of resources in each origin.
[0097] For the conditional reverse check module of the grade:
[0098] Grade code aggregation sub-module: Use the aggregation function of the search engine to aggregate qualified grade codes from the resource index;
[0099] Query sub-module: According to the aggregated grade codes, use the aggregation function of the search engine to query the qualified grades from the grade index as the limited range of the next aggregation;
[0100] Category aggregation sub-module: According to the limited scope, use the aggregation function of the search engine to aggregate all the major categories of brands from the brand index;
[0101] Sub-class aggregation sub-module: According to the aggregated grade categories, use sub-aggregation to aggregate the grade sub-categories from the grade index;
[0102] Grade aggregation sub-module: According to the aggregated grade sub-categories, use sub-aggregation to aggregate the corresponding grades from the grade index;
[0103] Type Priority Minimum Aggregation Sub-module: Aggregate the type priority minimum value and use it as the sub-aggregation of the major brand category and the sub-category of the brand, and return it to the aggregation of the major category and the sub-category of the brand, limiting the major category of the brand and the small category of the brand. The order of aggregation of classes;
[0104] Grade Priority Minimum Aggregation Sub-module: Aggregate Grade Priority Minimum Value as a sub-aggregation of Grade Aggregation, and return it to Grade Aggregation to limit the order of Grade Aggregation;
[0105] Classification sub-module: classify the grades not found in the query sub-module into other categories.
[0106] The following is an example of the origin and warehouse information query and aggregation of a steel e-commerce search condition area.
[0107] 1. Get a list of resources by searching
[0108] After a search in the search box, the search results that meet the conditions are as follows:
[0109] Table 1 Search Results
[0110]
[0111] 2. Use aggregation to check warehouse and origin information according to the search results
[0112] By aggregating the search results through the following aggregation words, you can dynamically obtain the information of the origin and warehouse: {"aggs":{"agg-manufactureCode":{"terms":{
[0113] "field":"manufactureCode","size":50,
[0114] "order":{"manufactureWeight":"desc"}
[0115]}, "agg-manufactureName":{"terms":{
[0116] "field":"manufactureName","size":1
[0117]}, "manufactureWeight": {
[0118] "sum":{"field":"balanceWeight"}}, "manufactureCount":{
[0119] "value_count":{"field":"resourceId"}}
[0120]}, "agg-warehouseCode":{"terms":{
[0121] "field":"warehouseCode","size":50,
[0122] "order":{"warehouseWeight":"desc"}
[0123]},"agg-warehouseName":{"terms":{
[0124] "field": "warehouseName", "size": 1
[0125]},"warehouseWeight":{"sum":{
[0126] "field":"balanceWeight"}
[0127]},"warehouseCount":{"value_count":{
[0128] "field":"resourceId"}}}}}
[0129] Table 2 The results of the reverse check of the origin information
[0130]
[0131] It can be seen from the results in Table 2 that the code, name, weight and quantity of sellable resources in each production area are counted, and the order of production areas is sorted in descending order according to the weight of saleable resources in this production area.
[0132] Table 3 Result of reverse check warehouse information
[0133]
[0134] Similarly, as shown in Table 3, the warehouse information is also counted in detail. The code, name, weight and quantity of resources that can be purchased under the warehouse are counted for each warehouse. The order of the warehouses is based on the available purchases of each warehouse Resource weights are sorted in descending order.
[0135] The following is an example of the query and aggregation of grades in a steel e-commerce search criteria area.
[0136] 1. Get a list of resources by searching
[0137] After a search in the search box, the search results that meet the conditions are as shown in Table 4:
[0138] Table 4 Search Results
[0139] resourceId (resource id) shopSight (brand) 1117432407 SPCC 1114636056 SPCC 1503948324 BLD 1134235123 Q235B 1112342148 S45C 1334621234 S45C 1145621367 ST12 1234521643 DC56D 1233423434 DC51D+Z 1235234131 DP600
[0140] Part of the data of the grade index is shown in Table 5:
[0141] Table 5 Grade Index
[0142]
[0143] The grades in the search results are firstly searched in the grade index to obtain a result set, in which the grades ST12 and DC56D are not included in the result set, the result set is aggregated as follows, and the grades that are not in the result set are classified into other categories:
[0144] {"aggs":{"agg-type":{"terms":{"field":"type","size":50,
[0145] "order":{"type-level":"asc"}}, "agg-subtype":{
[0146] "terms":{"field":"subtype","size":50,"order":{
[0147] "subtype-level":"asc"}}, "agg-finallyShopSign":{
[0148] "terms":{"field":"shopSignFilter","size":150,
[0149] "order":{"shopsign-level":"asc"}}, "shopsign-level":{
[0150] "min":{"field":"level"}}}, "subtype-level":{
[0151] "min":{"field":"typeLevel"}}}, "type-level":{
[0152] "min":{"field":"typeLevel"}}}}}
[0153] Table 6 Brand Reverse Inspection Results
[0154]
[0155] As can be seen from the reverse search results in Table 6, the grades in the resource search results are queried by category, the order of major categories, minor categories and grades can be arranged in the specified order, and grades that do not exist are classified into other categories middle.
[0156] Those skilled in the art know that, in addition to implementing the system provided by the present invention and its various devices, modules, and units in the form of purely computer-readable program codes, the system provided by the present invention and its various devices can be implemented by logically programming the method steps. , modules and units realize the same function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers and embedded microcontrollers. Therefore, the system provided by the present invention and its various devices, modules and units can be regarded as a kind of hardware components, and the devices, modules and units included in it for realizing various functions can also be regarded as hardware components. The device, module and unit for realizing various functions can also be regarded as both a software module for realizing the method and a structure in a hardware component.
[0157] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the above-mentioned specific embodiments, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essential content of the present invention. The embodiments of the present application and features in the embodiments may be combined with each other arbitrarily, provided that there is no conflict.