You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Varun Thacker (JIRA)" <ji...@apache.org> on 2018/10/08 19:45:00 UTC
[jira] [Commented] (SOLR-11644) RealTimeGet not working when
router.field is not an uniqeKey
[ https://issues.apache.org/jira/browse/SOLR-11644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16642378#comment-16642378 ]
Varun Thacker commented on SOLR-11644:
--------------------------------------
{quote}bq. Please note that RealTime Get or retrieval by id would also require the parameter _route_ (or shard.keys) to avoid a distributed search.
{quote}
And from Solr 4.5 CHANGES entry
{quote}* The routing parameter "shard.keys" is deprecated as part of SOLR-5017 .The new parameter name is '_route_' .
The old parameter should continue to work for another release (Noble Paul){quote}
We should remove "shard.keys" from the ref-guide then?
----
{quote}Given your schema, it should be:
{{get?candidate_id=1044101665}}
{quote}
Are we sure? It would be a strange syntax to support right? Here's an example from the ref-guide ( [https://lucene.apache.org/solr/guide/6_6/realtime-get.html] )
{code:java}
http://localhost:8983/solr/techproducts/get?ids=mydoc,IW-02{code}
Would this be supported?
Here's a snippet from RealTimeGetComponent that makes me think this won't be supported
{code:java}
final String id[] = params.getParams(ID);
final String ids[] = params.getParams("ids");{code}
----
{quote}Routing on one field (with duplicate values) and having a <uniqueKey> be a different field then expecting RTG to find the document seems "fraught".
{quote}
But the use-case would be valid right? I want to shard by a field which has company id information and at search time use the _{{_route__}}_ param so that I can limit the number of shards I go against. If it works for {{/select}} queries then shouldn't it also work for {{/get}} queries ?
> RealTimeGet not working when router.field is not an uniqeKey
> ------------------------------------------------------------
>
> Key: SOLR-11644
> URL: https://issues.apache.org/jira/browse/SOLR-11644
> Project: Solr
> Issue Type: Bug
> Security Level: Public(Default Security Level. Issues are Public)
> Affects Versions: 6.6.2, 7.1
> Reporter: Jarek Mazgaj
> Priority: Major
>
> I have a schema with following fields:
> {code:java}
> <field name="candidate_id" type="string" required="true"/>
> <field name="company_id" type="string" required="true"/>
> <field name="name" type="string"/>
> <uniqueKey>candidate_id</uniqueKey>
> {code}
> A collection was created with following parameters:
> * numShards=4
> * replicationFactor=2
> * *router.field=company_id*
> When I try to do a Real Time Get with no routing information:
> {code:java}
> /get?id=1044101665
> {code}
> I get an empty response.
> When I try to add routing information (search returns document for these values):
> {code:java}
> /get?id=1044101665&_route_=77493783
> {code}
> I get an error:
> {code}
> org.apache.solr.common.SolrException: Can't find shard 'applicants_shard7'
> at org.apache.solr.handler.component.RealTimeGetComponent.sliceToShards(RealTimeGetComponent.java:888)
> at org.apache.solr.handler.component.RealTimeGetComponent.createSubRequests(RealTimeGetComponent.java:835)
> at org.apache.solr.handler.component.RealTimeGetComponent.distributedProcess(RealTimeGetComponent.java:791)
> at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:345)
> at org.apache.solr.handler.RealTimeGetHandler.handleRequestBody(RealTimeGetHandler.java:46)
> at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:177)
> at org.apache.solr.core.SolrCore.execute(SolrCore.java:2484)
> at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:720)
> at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:526)
> at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:382)
> at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:326)
> at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1751)
> at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
> at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
> at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
> at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
> at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
> at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
> at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
> at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
> at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
> at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
> at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335)
> at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
> at org.eclipse.jetty.server.Server.handle(Server.java:534)
> at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)
> at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
> at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283)
> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108)
> at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
> at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
> at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
> at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
> at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
> at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
> at java.lang.Thread.run(Thread.java:748)
> {code}
> In logs I can find the following line:
> {code:java}
> 2017-11-15 13:20:09.369 INFO (qtp257895351-1305) [c:applicants s:shard9 r:core_node19 x:applicants_shard9_replica_n16] o.a.s.h.c.RealTimeGetComponent LOOKUP_SLICE:shard12=http://solr-applications1-int:8983/solr/applicants_shard12_replica_n22/
> {code}
> It seems that RealTimeGet checks the shard number for the "candidate_id" field (which is a unique field) and it gets: *shard7* (see exception).
> It should check the shard number for the "company_id" field (set by router.field) and then it would get the correct *shard12* (one visible in logs).
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org