searchArticle
Synopsis
TopCatalogItems searchArticle(SessionId sessionId,
SearchArticleParameterSet search,
LookupOptions options)
throws CatalogServiceFault;
See also: TopCatalogItems, SessionId, SearchArticleParameterSet, LookupOptions, CatalogServiceFault
The operation searches a set of catalogs for articles items matching the given manufacturer and series IDs and base article number.
The return value consists of the total number of hits found for the specified search parameters, and a sequence of scored catalog nodes, sorted in descending order according to the score.
If no catalog ID is specified and the brand and manufacturer Ids are empty, or the base article number is empty, the total number of hits is zero.
Otherwise, the operation determines the set of catalogs to search as follows: If search.catalogIds contains at least one catalog ID, these catalogs are used. Otherwise, all catalogs matching the brand and manufacturer IDs, if specified, are used.
The operation then iterates over all catalogs, looking for all catalog items matching the specified base article number. The list of matching items is then filtered as follows:
-
If the catalog item contains a non-empty manufacturer ID (OAS), and the search parameters contain a different non-empty manufacturer ID, the item is ignored.
-
If the search parameters contain a non-empty series ID and the catalog item contains a non-empty series ID (OAS), the item is ignored if both IDs are not equal.
-
If the search parameters contain a non-empty series ID and the catalog item contains no (or an empty) series ID, the catalog item is ignored if the article package identified by the catalog item (the package containing the product data of the article) does not contain articles of the specified series (according to the DSR file).
-
If the visibility flags of the catalog item are not compatible with the display mode specified by options.displayMode, the catalog item is ignored.
-
Then, each remaining catalog item may be replaced, depending on the flags
ViewItemsandCatalogItemsin search.flags, and the views specified in search.views, as follows: -
If
ViewItemsis set, orCatalogItemsis not set: -
All view items referencing the catalog item are determined. (view items are (leaf) nodes of a catalog tree/view). There may be multiple view items, either because the catalog item is referenced from multiple locations in the same catalog tree/view, or because there are multiple catalog views (OAS). It is also possible that there are no view items at all if the catalog item is not referenced by any catalog view.
-
Then, if search.views is not empty, the name of the view containing each view item is determined, and the view item is ignored if the view name is not found in
search.views.If neither
ViewItemsnorCatalogItemsis set: -
If the list of view items determined above is non-empty, the catalog item is replaced by the view items. Otherwise, the catalog item is retained.
-
If only
ViewItemsis set:The catalog item is always replaced by the (possibly empty) list of view items.
-
If only
CatItemsis set:No replacement takes place.
-
If both
ViewItemsandCatalogItemsare set:The possibly empty list of view items is inserted in front of the catalog item. The catalog item is always retained.
Then, for each view and catalog item remaining, a score is computed based on the comparison of the variant code of the item and the variant code given in search.variantCode. The exact algorithm used to compare both variant codes is unspecified and subject to change.
Once the scores have been computed, the item list is sorted according to the scores in descending order.
Finally, the operation returns the total number of items, and a sub-sequence of the sorted list of items, starting with the item whose index is given by search.firstHitPosition (default value is zero). The maximum number of items returned is given by search.numberOfHits (default value is ten).