ibm - Databean to fetch CATENTDESCOVR -
i need fetch data of catentdescovr using databean.
is there databean provided ibm data?
i using ibm websphere commerce v7.0 feature pack 8
this question , here below explanation how catentdescovr works , answer based on wcs 7.0 , fep 7 . believe fep 8 have same api , don't think ibm enhanced in fep8!
- the information of catentdescovr indexed , stored in solr, reason indexing searching , spellcheck, can see how copying these info defultsearch , spellcheck make these values searchable , part of spellcheck (end of schema.xml).
if @ how these data indexed , stored in solr in schema.xml find following line
<!-- catentry's description override: map table catentdescovr --> <field name="nameoverride" type="wc_text" indexed="true" stored="true" multivalued="true"/> <field name="shortdescriptionoverride" type="wc_text" indexed="true" stored="true" multivalued="true"/> <field name="keywordoverride" type="wc_text" indexed="true" stored="true" multivalued="true"/>
please note here multivalued="true"
, means if have multible stores belongs same esite , solr index nameovr , descovr multivalued catentryid , solr have no idea overridden name belongs store , bean said , ibm solr index master catalog data not store specific data .
this brings question how overridden name shown per store in store front?
the answer utilizing wc-search post-processor:
com.ibm.commerce.foundation.server.services.rest.search.postprocessor.solr.solrrestsearchcatalogentryviewdescriptionquerypostprocessor
if @ implementation of postprocessor find following high level steps :
1- catovrgrpid by:
catovrgrpid = catalogoverridehelper.getoverridegroupidforstore(this.istoreid)
2- required overridden data calling dsl service:
jdbcqueryservice service = new jdbcqueryservice("com.ibm.commerce.catalog"); queryparameters.put("language", langids); queryparameters.put("uniqueid", catentryuniqueids); queryparameters.put("catoverridegroupid", groupids); service.executequery("ibm_get_catentrydescoverride_by_langid_and_catentryid_and_groupid", queryparameters);
3- convert array list returned json compatible result:
populateoverridecatalogentries((list)listofphysicalobjects, catalogentryviews);
you can reused codes above , try de-compile solrrestsearchcatalogentryviewdescriptionquerypostprocessor
understand how can read these information database.
the query ibm_get_catentrydescoverride_by_langid_and_catentryid_and_groupid
exist under search/xml/config/com.ibm.commerce.catalog/wc-query-utilities.tpl
hope informative you.
thanks abed
Comments
Post a Comment