Method and apparatus for generating a keyword list from tables to facilitate searching an electronic catalog6728696Abstract A computer-implemented method is described, for searching for items in an electronic catalog, e.g. an on-line catalog accessible over the Internet. A hierarchy of category names is defined, each item in the electronic catalog being associated with one of those category names. When a search page is accessed, the category names are scanned, to generate a list of words that appear in the category names at any level of the hierarchy. The list of words is displayed in the search page, allowing a user to select one. When the user selects a word from the list, a list of items whose category names contain the selected word is displayed. Claims What is claimed is: Description BACKGROUND TO THE INVENTION
Catalog Catalog Category Parent
Index IndexText Level Index ...
1 Hardware 1 0 ...
2 Printers 2 1 ...
3 Fax/Modem Cards 2 1 ...
: : : : ...
10 Consumables 1 0 ...
11 Toner 2 10 ...
12 Printer 3 11 ...
13 Laser 3 11 ...
: : : : ...
20 Paper 2 10 ...
21 Printer 3 20 ...
: : : : ...
It can be seen that the CatalogCategory table includes the following columns: CatalogIndex--an index number, uniquely identifying a particular category. CatalogIndexText--a text string, indicating the name of the category. CategoryLevel--a number indicating the level of the category within the hierarchy. The top-level categories ("Hardware" and "Consumables") are at level 1. In the present example, the hierarchy is restricted to three levels, i.e. the maximum level number is 3. ParentIndex--a pointer to the parent of the current category within the hierarchy. In the above example, "Consumables" is the parent category for "Toner" and "Paper". The Product table 18 contains an entry for each product in each of the electronic catalogs. This table includes the following columns: PartNumber--a number identifying a particular product. CatalogIndex--a reference to an entry in the CatalogCategory table. It can be seen that the Product table therefore assigns each product to a particular category. In general, all products of the same type (e.g. printers) are assigned to the same category. The CustomerPrice table 19 includes the following columns: CustomerCode--a code identifying a particular customer catalog. PartNumber--a reference to an entry in the Product table, identifying a particular product. Price--the price of this product in this catalog. (Different catalogs may contain different prices, depending on discounts etc. that may have been negotiated). The CustomerPrice table holds an entry for every permitted combination of customer and product. If an entry does not exist for a particular customer-product combination, this means that the customer in question is not able to access this product through the electronic catalog system. The web pages 15 include a "Search" page, which allows a customer to search for products. Whenever this search page is opened, a SelectWords routine is executed, e.g. by means of ASP code embedded in the page. Referring to FIG. 3, the SelectWords routine performs the following steps. (Step 31) The SelectWords routine first checks whether an array, referred to hereinafter as the SortedCategoryWords array, has already been created for the present session. If so, the SelectWords routine immediately exits. If, on the other hand, a SortedCategoryWords array has not yet been created in the present session, the routine continues with the following steps. (Step 32) SelectWords executes an SQL query on the database tables 17-19, and stores the result in a result set RS. The SQL query is as follows: SELECT CatalogIndexText, cc.CatalogIndex FROM CatalogCategory cc, CustomerPrice cp, Product p WHERE cc.CatalogIndex=p.CatalogIndex AND cp.PartNumber=p.PartNumber AND cp.CustomerCode=SessionCC UNION SELECT cc2.CatalogIndexText, cc2.CatalogIndex FROM CatalogCategory cc, CatalogCategory cc2, CustomerPrice cp, Product p WHERE cc.CategoryLevel=3 AND cc.ParentIndex=cc2.CatalogIndex AND cc.CatalogIndex=p.CatalogIndex AND cp.PartNumber=p.PartNumber AND cp.CustomerCode=SessionCC In the above, SessionCC represents the customer code of the customer who initiated the current session. It can be seen that the first part of this query (up to the keyword "UNION") selects CatalogIndexText and CatalogIndex from the CatalogCategory table for all cases where an item in the category in question may be ordered by the current customer. These categories will all be leaf nodes of the category hierarchy. The second part of this query (following the keyword "UNION") selects these values from all entries in the CatalogCategory table that are parents of level 3 entries that may be ordered by the current customer. As an example, the result set RS might appear as follows:
CatalogIndexText Catalog Index
Printers 2
Fax/Modem Cards 3
Printer 12
Laser 13
Printer 21
Toner 11
Paper 20
(Step 33) Each of the results in RS is then selected in turn, until the last result in RS is reached. For each result in RS, a SplitWords function is called. This splits compound entries in the CatalogIndexText (i.e. entries comprising multiple words separated by spaces and slashes) into discrete words. For example, the entry "Fax/Modem Cards" is split into three separate words "Fax", "Modem" and "Cards". The SplitWords function in turn calls a CheckWord function, which replaces certain predetermined words with a generalised version of that word, which covers variants of the word and related words. For example: "CD", "CD-R", "CD-ROM" or "CD-ROMs" is replaced by "CD(-R)/CD-ROM(s)" "Card" or "Cards" is replaced by "Card(s)" "Modem" or "Modems" is replaced by "Modem(s)" "Printer", "Printers", "Print" or "Printing" is replaced by "Print(ing)/Printer(s)" The CheckWord function thus provides a way of removing certain inconsistencies in the category names. Any words not replaced by CheckWord (such as "Fax", "Toner" and "Paper") simply remain as they are. Each of these words is then added to a CategoryWords array, along with its corresponding CatalogIndex number. If the word already appears in the array, the CatalogIndex number is simply appended to the existing entry for that word, separated by a comma from the previous number. As an example, the CategoryWords array might appear as follows:
Word Catalog Index
Print(ing)/Print(ers) 2, 12, 21
Fax 3
Modem(s) 3
Card(s) 3
Laser 13
Toner 11
Paper 20
CategoryWords thus comprises a list of words that appear in the category names at any level of the hierarchy, together with a comma-separated list of CatalogIndex values for each of those words. (Step 34) CategoryWords is then sorted into alphabetical order on "Word", to produce a new array, SortedCategoryWords. (Step 35) SortedCategoryWords is then stored in a session variable, so that it will be available the next time the customer accesses the search page in the same session. FIG. 4 is a simplified view of a typical Search page. The page includes a drop-down list 41, in which all the words from SortedCategoryList are displayed. The customer can select any one of these words, by clicking on it in the normal manner. The page also includes a Search button 42. Clicking on this button calls a function that looks up the selected word in the SortedCategoryWords array, to get the CatalogIndex values associated with that word. These CatalogIndex values are then used to look up the other database tables, to get information about the associated products, and a list of these products is displayed in a scrollable window 43. The displayed list of products may for example be sorted into price order or alphabetically. In the example shown in FIG. 4, the customer has selected "Print(ing)/Print(ers)", and as a result a list of all products whose category names contain the words "Printer", "Printers", "Print" or "Printing" is displayed in the window 43. The customer may then select products from this list, for adding to a purchase order. The manner in which the products are selected and the purchase order is processed form no part of the present invention and so will not be described further. Some Possible Modifications It will be appreciated that many modifications may be made to the system described above without departing from the scope of the present invention. For example, the category hierarchy is not necessarily restricted to three levels. Also, different catalogs 16 may reside on different computers.
|
Same subclass Same class Consider this |
||||||||||
