You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by mganeshs <mg...@live.in> on 2017/05/22 04:07:13 UTC

Join not working in Solr 6.5

Hi,

I have following records / documents with Parent entity

id,type_s,P_hid_s,P_name_s,P_pid_s
1000000001,PERSON,1000000001,Parent1,1000000001

And following records / documents with child entity

id,type_s,C_hid_s,C_name_s,C_pid_s
1000000002,PERSON,1000000002,Child2,1000000001
1000000003,PERSON,1000000003,Child3,1000000001
1000000004,PERSON,1000000004,Child4,1000000001

Now when I try to join and get all children of parent1 whose id is
1000000001,

http://localhost:8983/solr/basicns/select?indent=on&q={!join from id to
C_pid_s} type_s:PERSON&wt=json


I get following exception
 "error":{
    "trace":"java.lang.NullPointerException\r\n\tat
org.apache.solr.search.JoinQuery.hashCode(JoinQParserPlugin.java:525)\r\n\tat
org.apache.solr.search.QueryResultKey.<init>(QueryResultKey.java:46)\r\n\tat
org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:1754)\r\n\tat
org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:609)\r\n\tat
org.apache.solr.handler.component.QueryComponent.process(QueryComponent.java:547)\r\n\tat
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:295)\r\n\tat
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:173)\r\n\tat
org.apache.solr.core.SolrCore.execute(SolrCore.java:2440)\r\n\tat
org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:723)\r\n\tat
org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:529)\r\n\tat
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:347)\r\n\tat
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:298)\r\n\tat
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1691)\r\n\tat
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)\r\n\tat
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\r\n\tat
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)\r\n\tat
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)\r\n\tat
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)\r\n\tat
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)\r\n\tat
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)\r\n\tat
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)\r\n\tat
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\r\n\tat
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)\r\n\tat
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)\r\n\tat
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)\r\n\tat
org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335)\r\n\tat
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)\r\n\tat
org.eclipse.jetty.server.Server.handle(Server.java:534)\r\n\tat
org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)\r\n\tat
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)\r\n\tat
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)\r\n\tat
org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)\r\n\tat
org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)\r\n\tat
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)\r\n\tat
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)\r\n\tat
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)\r\n\tat
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)\r\n\tat
org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)\r\n\tat
java.lang.Thread.run(Thread.java:745)\r\n",
    "code":500}}


Is there a bug in 6.5? or something going wrong. I have used basic config
comes with example and created collection with one shard only and not using
multiple shards.

Early response will be very much appreciated....






--
View this message in context: http://lucene.472066.n3.nabble.com/Join-not-working-in-Solr-6-5-tp4336247.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Join not working in Solr 6.5

Posted by mganeshs <mg...@live.in>.
Thanks for bringing up performance perspective. Is there any bench mark on
join performance when number of shards is more than 10 where documents are
indexed based on router.field.

Are you suggesting instead of router.field go for streaming expressions or
use join with router.field and then go for streaming expressions ? Can you
detail out pls ?

Thanks,



--
View this message in context: http://lucene.472066.n3.nabble.com/Join-not-working-in-Solr-6-5-tp4336247p4336451.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Join not working in Solr 6.5

Posted by Erick Erickson <er...@gmail.com>.
this will likely be "interesting" from a performance perspective. You
might try Streaming, especially StreamingExpressions and ParallelSQL
depending on what you need this for.

Best,
Erick

On Mon, May 22, 2017 at 12:05 AM, Damien Kamerman <da...@gmail.com> wrote:
> I use a router.field so docs that I join from/to are always in the same
> shard.  See
> https://cwiki.apache.org/confluence/display/solr/Shards+and+Indexing+Data+in+SolrCloud#ShardsandIndexingDatainSolrCloud-DocumentRouting
>
> There is an open ticket SOLR-8297
> https://issues.apache.org/jira/browse/SOLR-8297 Allow join query over 2
> sharded collections: enhance functionality and exception handling
>
>
>
> On 22 May 2017 at 16:01, mganeshs <mg...@live.in> wrote:
>
>> Is there any possibility of supporting joins across multiple shards in near
>> future ? How to achieve the join when our data is spread-ed across multiple
>> shards. This is very much mandatory when we need to scale out.
>>
>> Any workarounds if out-of-box possibility is not there ?
>>
>> Thanks,
>>
>>
>>
>>
>>
>> --
>> View this message in context: http://lucene.472066.n3.
>> nabble.com/Join-not-working-in-Solr-6-5-tp4336247p4336256.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>

Re: Join not working in Solr 6.5

Posted by Damien Kamerman <da...@gmail.com>.
I use a router.field so docs that I join from/to are always in the same
shard.  See
https://cwiki.apache.org/confluence/display/solr/Shards+and+Indexing+Data+in+SolrCloud#ShardsandIndexingDatainSolrCloud-DocumentRouting

There is an open ticket SOLR-8297
https://issues.apache.org/jira/browse/SOLR-8297 Allow join query over 2
sharded collections: enhance functionality and exception handling



On 22 May 2017 at 16:01, mganeshs <mg...@live.in> wrote:

> Is there any possibility of supporting joins across multiple shards in near
> future ? How to achieve the join when our data is spread-ed across multiple
> shards. This is very much mandatory when we need to scale out.
>
> Any workarounds if out-of-box possibility is not there ?
>
> Thanks,
>
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.
> nabble.com/Join-not-working-in-Solr-6-5-tp4336247p4336256.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Join not working in Solr 6.5

Posted by mganeshs <mg...@live.in>.
Is there any possibility of supporting joins across multiple shards in near
future ? How to achieve the join when our data is spread-ed across multiple
shards. This is very much mandatory when we need to scale out. 

Any workarounds if out-of-box possibility is not there ? 

Thanks,





--
View this message in context: http://lucene.472066.n3.nabble.com/Join-not-working-in-Solr-6-5-tp4336247p4336256.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Join not working in Solr 6.5

Posted by mganeshs <mg...@live.in>.
Perfect !

Sorry I overlooked and missed "="

Thanks,



--
View this message in context: http://lucene.472066.n3.nabble.com/Join-not-working-in-Solr-6-5-tp4336247p4336251.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Join not working in Solr 6.5

Posted by Damien Kamerman <da...@gmail.com>.
Your join should be:

{!join from=id to=C_pid_s}

On 22 May 2017 at 14:07, mganeshs <mg...@live.in> wrote:

> Hi,
>
> I have following records / documents with Parent entity
>
> id,type_s,P_hid_s,P_name_s,P_pid_s
> 1000000001,PERSON,1000000001,Parent1,1000000001
>
> And following records / documents with child entity
>
> id,type_s,C_hid_s,C_name_s,C_pid_s
> 1000000002,PERSON,1000000002,Child2,1000000001
> 1000000003,PERSON,1000000003,Child3,1000000001
> 1000000004,PERSON,1000000004,Child4,1000000001
>
> Now when I try to join and get all children of parent1 whose id is
> 1000000001,
>
> http://localhost:8983/solr/basicns/select?indent=on&q={!join from id to
> C_pid_s} type_s:PERSON&wt=json
>
>
> I get following exception
>  "error":{
>     "trace":"java.lang.NullPointerException\r\n\tat
> org.apache.solr.search.JoinQuery.hashCode(JoinQParserPlugin.java:525)\r\
> n\tat
> org.apache.solr.search.QueryResultKey.<init>(QueryResultKey.java:46)\r\n\
> tat
> org.apache.solr.search.SolrIndexSearcher.getDocListC(
> SolrIndexSearcher.java:1754)\r\n\tat
> org.apache.solr.search.SolrIndexSearcher.search(
> SolrIndexSearcher.java:609)\r\n\tat
> org.apache.solr.handler.component.QueryComponent.
> process(QueryComponent.java:547)\r\n\tat
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(
> SearchHandler.java:295)\r\n\tat
> org.apache.solr.handler.RequestHandlerBase.handleRequest(
> RequestHandlerBase.java:173)\r\n\tat
> org.apache.solr.core.SolrCore.execute(SolrCore.java:2440)\r\n\tat
> org.apache.solr.servlet.HttpSolrCall.execute(
> HttpSolrCall.java:723)\r\n\tat
> org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:529)\r\n\tat
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(
> SolrDispatchFilter.java:347)\r\n\tat
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(
> SolrDispatchFilter.java:298)\r\n\tat
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.
> doFilter(ServletHandler.java:1691)\r\n\tat
> org.eclipse.jetty.servlet.ServletHandler.doHandle(
> ServletHandler.java:582)\r\n\tat
> org.eclipse.jetty.server.handler.ScopedHandler.handle(
> ScopedHandler.java:143)\r\n\tat
> org.eclipse.jetty.security.SecurityHandler.handle(
> SecurityHandler.java:548)\r\n\tat
> org.eclipse.jetty.server.session.SessionHandler.
> doHandle(SessionHandler.java:226)\r\n\tat
> org.eclipse.jetty.server.handler.ContextHandler.
> doHandle(ContextHandler.java:1180)\r\n\tat
> org.eclipse.jetty.servlet.ServletHandler.doScope(
> ServletHandler.java:512)\r\n\tat
> org.eclipse.jetty.server.session.SessionHandler.
> doScope(SessionHandler.java:185)\r\n\tat
> org.eclipse.jetty.server.handler.ContextHandler.
> doScope(ContextHandler.java:1112)\r\n\tat
> org.eclipse.jetty.server.handler.ScopedHandler.handle(
> ScopedHandler.java:141)\r\n\tat
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(
> ContextHandlerCollection.java:213)\r\n\tat
> org.eclipse.jetty.server.handler.HandlerCollection.
> handle(HandlerCollection.java:119)\r\n\tat
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(
> HandlerWrapper.java:134)\r\n\tat
> org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(
> RewriteHandler.java:335)\r\n\tat
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(
> HandlerWrapper.java:134)\r\n\tat
> org.eclipse.jetty.server.Server.handle(Server.java:534)\r\n\tat
> org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320)\r\n\tat
> org.eclipse.jetty.server.HttpConnection.onFillable(
> HttpConnection.java:251)\r\n\tat
> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(
> AbstractConnection.java:273)\r\n\tat
> org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)\r\n\tat
> org.eclipse.jetty.io.SelectChannelEndPoint$2.run(
> SelectChannelEndPoint.java:93)\r\n\tat
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.
> executeProduceConsume(ExecuteProduceConsume.java:303)\r\n\tat
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.
> produceConsume(ExecuteProduceConsume.java:148)\r\n\tat
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(
> ExecuteProduceConsume.java:136)\r\n\tat
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
> QueuedThreadPool.java:671)\r\n\tat
> org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(
> QueuedThreadPool.java:589)\r\n\tat
> java.lang.Thread.run(Thread.java:745)\r\n",
>     "code":500}}
>
>
> Is there a bug in 6.5? or something going wrong. I have used basic config
> comes with example and created collection with one shard only and not using
> multiple shards.
>
> Early response will be very much appreciated....
>
>
>
>
>
>
> --
> View this message in context: http://lucene.472066.n3.
> nabble.com/Join-not-working-in-Solr-6-5-tp4336247.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>