categoryname search in Websphere Commerce 8 SOLR

不打扰是莪最后的温柔 提交于 2019-12-11 14:17:31

问题


We noticed following issues with 'categoryname' field search in WebSphere Commerce, so trying to understand if it's rather a data set up issue or Commerce Search/SOLR is not designed to work with such type of scenarios.

We have more than 100 catalogs that site and customer specific, customers get their own catalog/category/items when they log in and there is no issue with category browsing or order placement, but having an issue with OOB keyword search since OOB IBM_findProductsBySearchTerm profile includes 'categoryname' as part of 'defaultSearch' while making SOLR calls along with name, shortDesc, keyword, and few other fields.

Having said that we are seeing too many and unwanted results that are not relevant for given search keyword since a match is found in some other customer's catalog category(s) name. We do see correct results if I comment below in wc-search.xml file, but this prevents searching categories in the current catalog as well.

<_config:field name="defaultSearch"/>
<_config:field name="categoryname"/>

For example, following are the categories that match 'candy' keyword but are not part of the current site and catalog(site with catalog D) keyword search, how do we prevent these getting scored during keyword search and still use categoryname search?

Rubys' candy -- in catalog A Smith dairy stuff -- in catalog B Kitchen Utensils -- in catalog C Candy supplies -- in catalog E

Prep kits -- in catalog D, no items in this category have word 'candy' in it.

Basically we are getting items from 'Prep kits' category as well for the site with catalog D in keyword search since other catalog's categories have word 'candy' in it. In nutshell we are getting too many and non-relevant results the moment 'categoryname' field used in wc-search.xml or in direct SOLR query(qf=categoryname).

I believe the issue is because the categoryname is indexed as wc_text and multivalued with comma separated data across all catalogs in the system.

What kind of customization needs to be done to fix this issue, so that the search would return relevant results?

Thanks


回答1:


There is nothing OOB since categoryname index data has no catalog_id visibility. Solved the issue by adding a dynamic and multivalued categoryname_ field and used that to replace existing categoryname qf in a custom ExpressionProvider class. This limits keyword searches to current catalog(s) categories only and returns correct results.



来源:https://stackoverflow.com/questions/55750681/categoryname-search-in-websphere-commerce-8-solr

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!