Thx Jeon. That worked. Now both the fields are returned in the response. Its a bit inefficient but works neverthless. Suchi
On Sat, Nov 15, 2014 at 10:44 PM, Jeon Woosung <jeonwoos...@gmail.com> wrote: > I guess that I caused by shard which return renamed field. > > following code is source code of solr 4.6 > ==================================================================== > =================================== > 986: if ((sreq.purpose & ShardRequest.PURPOSE_GET_FIELDS) != 0) { > 987: boolean returnScores = (rb.getFieldFlags() & > SolrIndexSearcher.GET_SCORES) != 0; > 988: > 989: assert(sreq.responses.size() == 1); > 990: ShardResponse srsp = sreq.responses.get(0); > 991: SolrDocumentList docs = > (SolrDocumentList)srsp.getSolrResponse().getResponse().get("response"); > 992: > 993: String keyFieldName = > rb.req.getSchema().getUniqueKeyField().getName(); > 994: boolean removeKeyField = > !rb.rsp.getReturnFields().wantsField(keyFieldName); > 995: > 996: for (SolrDocument doc : docs) { > 997: Object id = doc.getFieldValue(keyFieldName); > 998: ShardDoc sdoc = rb.resultIds.get(id.toString()); > > ==================================================================================================== > > If each shard return renamed field name instead of keyFieldName(UniqueKey), > "id" of 998 line could be null. Because the doc of 996 line wouldn't have > "keyFieldName" > > > So if you are urgent or you can not wait for patch, you can add unique > field like this. > eg) http:// > <host_name>/solr/<collection_name>/select?q=dress&fl=a1:p1&fl=p1 > > > > > On Sat, Nov 15, 2014 at 11:26 PM, Garth Grimm < > garthgr...@averyranchconsulting.com> wrote: > > > https://issues.apache.org/jira/browse/SOLR-6744 created. > > > > And hopefully correctly, since that’s my first. > > On Nov 15, 2014, at 9:12 AM, Garth Grimm < > > garthgr...@averyranchconsulting.com<mailto: > > garthgr...@averyranchconsulting.com>> wrote: > > > > I see the same issue on 4.10.1. > > > > I’ll open a JIRA if I don’t see one. > > > > I guess the best immediate work around is to copy the unique field, and > > use that field for renaming? > > On Nov 15, 2014, at 3:18 AM, Suchi Amalapurapu <su...@bloomreach.com > > <mailto:su...@bloomreach.com>> wrote: > > > > Solr version:4.6.1 > > > > On Sat, Nov 15, 2014 at 12:24 PM, Jeon Woosung <jeonwoos...@gmail.com > > <mailto:jeonwoos...@gmail.com>> > > wrote: > > > > Could you let me know version of the solr? > > > > On Sat, Nov 15, 2014 at 5:05 AM, Suchi Amalapurapu <su...@bloomreach.com > > <mailto:su...@bloomreach.com>> > > wrote: > > > > Hi > > Getting the following exception when using fl renaming with unique key in > > the schema. > > http://<host_name>/solr/<collection_name>/select?q=dress&fl=a1:p1 > > > > where p1 is the unique key for <collection_name> > > For collections with single shard, this works flawlessly but results in > > the > > following exception in case of multiple shards. > > > > How do we fix this? Stack trace below. > > Suchi > > > > error": {"trace": "java.lang.NullPointerException\n\tat > > > > > > > > > org.apache.solr.handler.component.QueryComponent.returnFields(QueryComponent.java:998)\n\tat > > > > > > > > > org.apache.solr.handler.component.QueryComponent.handleRegularResponses(QueryComponent.java:653)\n\tat > > > > > > > > > org.apache.solr.handler.component.QueryComponent.handleResponses(QueryComponent.java:628)\n\tat > > > > > > > > > org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:311)\n\tat > > > > > > > > > org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)\n\tat > > org.apache.solr.core.SolrCore.execute(SolrCore.java:1859)\n\tat > > > > > > > > > org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:721)\n\tat > > > > > > > > > org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:417)\n\tat > > > > > > > > > org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:201)\n\tat > > > > > > > > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)\n\tat > > > > > > > > > org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)\n\tat > > > > > > > > > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)\n\tat > > > > > > > > > org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)\n\tat > > > > > > > > > org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)\n\tat > > > > > > > > > org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)\n\tat > > > > > > > > > org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)\n\tat > > > > > > > > > org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)\n\tat > > > > > > > > > org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)\n\tat > > > > > > > > > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)\n\tat > > > > > > > > > org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)\n\tat > > > > > > > > > org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)\n\tat > > > > > > > > > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)\n\tat > > org.eclipse.jetty.server.Server.handle(Server.java:368)\n\tat > > > > > > > > > org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)\n\tat > > > > > > > > > org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)\n\tat > > > > > > > > > org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:942)\n\tat > > > > > > > > > org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1004)\n\tat > > org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640)\n\tat > > > > > org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)\n\tat > > > > > > > > > org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)\n\tat > > > > > > > > > org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:264)\n\tat > > > > > > > > > org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)\n\tat > > > > > > > > > org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)\n\tat > > java.lang.Thread.run(Thread.java:662)\n","code": 500 > > > > > > > > > > -- > > *God bless U* > > > > > > > > > > > -- > *God bless U* >