APAR status
Closed as new function.
Error description
Whenever trying to sort against a "string" column from the extension index, an UnsupportedOperationException will be thrown. Using other native types like float and int and sorting these fields (even multiple of them together) from the extension index works fine; the issue is just with "string" type. To reproduce the scenario, simply add a dynamic text field (or reuse inv_status_*) to the Inventory index. Then modify the DIH query to populate this column. Here's the change in wc-data-config.xml to reproduce the problem: <entity name="ItemBean" processor="com.ibm.commerce.foundation.internal.server.services. search.dataimport.solr.MultiplexSqlEntityProcessor" dataSource="WC database" primarykey="catentry_id" query="SELECT INVENTORY.CATENTRY_ID, INVENTORY.STORE_ID, INVENTORY.FFMCENTER_ID, INVENTORY.QUANTITY, LISTPRICE.OID FROM INVENTORY, LISTPRICE WHERE INVENTORY.QUANTITYMEASURE = 'C62' AND INVENTORY.CATENTRY_ID = LISTPRICE.CATENTRY_ID AND LISTPRICE.CURRENCY = 'USD' AND INVENTORY.CATENTRY_ID IN ( SELECT CATENTRY.CATENTRY_ID FROM CATENTRY, CATGPENREL WHERE CATGPENREL.CATALOG_ID = 10051 AND CATENTRY.MARKFORDELETE = 0 AND CATENTRY.CATENTRY_ID = CATGPENREL.CATENTRY_ID AND CATENTRY.CATENTTYPE_ID = 'ItemBean') ORDER BY INVENTORY.CATENTRY_ID, INVENTORY.STORE_ID, INVENTORY.FFMCENTER_ID"> <field column="CATENTRY_ID" name="ids" /> <field column="CATENTRY_ID" name="catentry_id" /> <field column="STORE_ID" name="storeId" /> <field column="FFMCENTER_ID" name="ffmccenterId" /> <field column="QUANTITY" name="quantity" /> <field column="OID" name="oid" /> <field column="strlocqty" dynamicFieldName="inv_strlocqty_%storeId%_%ffmccenterId%" dynamicFieldValue="%quantity%" multiValueAction="replace" /> <field column="xyz" dynamicFieldName="inv_status_oid" dynamicFieldValue="%oid%" multiValueAction="replace" /> </entity> then run the SQL to update LISTPRICE.OID to be CATENTRY_ID: UPDATE LISTPRICE SET OID = CHAR(CATENTRY_ID); After a full reindex on Inventory using di-buildindex, run the following query from the Web browser: http://localhost:3737/solr/MC_10051_CatalogEntry_Inventory_gener ic/select?q=*:*&fl=inv_status_oid&start=0&sort=inv_status_oid asc you'll notice the following exception in the response: [3/11/15 23:09:41:458 EDT] 00000016 SolrDispatchF E org.apache.solr.common.SolrException log null:java.lang.UnsupportedOperationException at org.apache.solr.search.TermOrdValComparator_SML.copy(MissingStri ngLastComparatorSource.java:97) at com.ibm.commerce.foundation.internal.server.services.search.comp onent.solr.SolrSearchExtensionComparatorSource$1.copy(SolrSearch ExtensionComparatorSource.java:106) at org.apache.lucene.search.TopFieldCollector$OneComparatorNonScori ngCollector.collect(TopFieldCollector.java:86) at org.apache.solr.search.DocSetDelegateCollector.collect(DocSetDel egateCollector.java:41) at org.apache.lucene.search.Scorer.score(Scorer.java:65) at org.apache.lucene.search.ConstantScoreQuery$ConstantScorer.score (ConstantScoreQuery.java:245) at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java :612) at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java :297) at org.apache.solr.search.SolrIndexSearcher.getDocListAndSetNC(Solr IndexSearcher.java:1619) at org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSe archer.java:1366) at org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearche r.java:457) at com.ibm.commerce.foundation.internal.server.services.search.comp onent.solr.SolrSearchMultipleQueryComponent.process(SolrSearchMu ltipleQueryComponent.java:1076) at org.apache.solr.handler.component.SearchHandler.handleRequestBod y(SearchHandler.java:208) at org.apache.solr.handler.RequestHandlerBase.handleRequest(Request HandlerBase.java:135) at org.apache.solr.core.SolrCore.execute(SolrCore.java:1816) at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchF ilter.java:656) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatch Filter.java:359) at com.ibm.commerce.foundation.internal.server.services.search.serv let.solr.SolrSearchDispatchFilter.doFilter(SolrSearchDispatchFil ter.java:100) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatch Filter.java:155) at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(Fi lterInstanceWrapper.java:190) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebApp FilterChain.java:125) at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAp pFilterChain.java:80) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebA ppFilterManager.java:908) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(Ser vletWrapper.java:939) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(Ser vletWrapper.java:507) at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest (ServletWrapperImpl.java:181) at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleReques t(CacheServletWrapper.java:91) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer. java:878) at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContai ner.java:1592) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLin k.java:191) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscr imination(HttpInboundLink.java:453) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRe quest(HttpInboundLink.java:515) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequ est(HttpInboundLink.java:306) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpI nboundLink.java:277) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sen dToDiscriminators(NewConnectionInitialReadCallback.java:214) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.com plete(NewConnectionInitialReadCallback.java:113) at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureComp leted(AioReadCompletionListener.java:175) at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyn cFuture.java:217) at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncC hannelFuture.java:161) at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHand ler.java:775) at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1656)
Local fix
Problem summary
USERS AFFECTED: IT developer PROBLEM ABSTRACT: UnsupportedOperationException when sorting Inventory index BUSINESS IMPACT: Cannot perform sorting of string type custom data in extension index RECOMMENDATION:
Problem conclusion
The issue is coming from this code SolrSearchExtensionComparatorSource where the copy method is being called but the FieldComparator type returned is TermOrdValComparator_SML and this class does not support the copy() operation. The fix is to provide the proper support for this data type.
Temporary fix
Comments
APAR Information
APAR number
JR52856
Reported component name
WC BUS EDITION
Reported component ID
5724I3800
Reported release
700
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
YesSpecatt / New Function
Submitted date
2015-03-17
Closed date
2015-03-26
Last modified date
2015-03-26
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
WC BUS EDITION
Fixed component ID
5724I3800
Applicable component levels
R700 PSY
UP
[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSYSYL","label":"WebSphere Commerce Enterprise"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.0","Line of Business":{"code":"LOB31","label":"WCE Watson Marketing and Commerce"}}]
Document Information
Modified date:
11 December 2021