With little modification, it worked.
fq=-{!join from=aId to=id fromIndex=b}-statusId:1
() wrapping –statusId:1 did not work.
Thanks
Akshay
From: Mikhail Khludnev [mailto:[email protected]]
Sent: Tuesday, December 06, 2016 5:12 PM
To: [email protected]
Subject: Re: Solr outer join / not join query
q=*:* -{!join from=aId to=id fromIndex=b}(-statusId:1)
On Tue, Dec 6, 2016 at 2:04 PM, Akshay Vadher <[email protected]
<mailto:[email protected]> > wrote:
I have posted a stackoverflow question too -
http://stackoverflow.com/questions/40993515/solr-outer-join-not-join-query.
I may be asking too much but I want to do a left outer join between two cores
and get data from Aonly where B does not have related data.
Following is exactly my equivalent SQL query (for simplicity I have removed
other conditions),
1. SELECT A.* FROM A AS A
WHERE A.ID <http://A.ID> NOT IN (SELECT B.A_ID FROM B AS B WHERE B.STATUS_ID
!= 1)
I understand that solr join is actually subquery, I need data from only A.
It would be very easy if the not was not there in where condition for sub query.
For example,
2. SELECT A.* FROM A AS A
WHERE A.ID <http://A.ID> IN (SELECT B.A_ID FROM B AS B WHERE B.STATUS_ID != 1)
I can have q={!join from=aId to=id fromIndex=b}(-statusId:1).
How can I do a nagete here, i.e. solr query for 1
Regards,
Akshay Vadher
Senior Software Engineer
Synoverge Technologies Pvt. Ltd.
[email protected] <mailto:[email protected]> |
<http://tel:+91%2096620%2059401/> +91 96620 59401
“You know, sometimes all you need is twenty seconds of insane courage. Just
literally twenty seconds of just embarrassing bravery. And I promise you,
something great will come of it.”
― <http://www.goodreads.com/author/show/1350576.Benjamin_Mee> Benjamin Mee,
<http://www.goodreads.com/work/quotes/3805656> We Bought a Zoo
_______________________________________________
CONFIDENTIALITY NOTICE:
The contents of this email message and any attachments are intended solely for
the addressee(s) and may contain confidential and/or privileged information and
may be legally protected from disclosure. If you are not the intended recipient
of this message, or if this message has been addressed to you in error, please
immediately alert the sender by reply email and then delete this message and
any attachments. If you are not the intended recipient, you are hereby notified
that any use, dissemination, copying, or storage of this message or its
attachments is strictly prohibited
--
Sincerely yours
Mikhail Khludnev
_______________________________________________
CONFIDENTIALITY NOTICE:
The contents of this email message and any attachments are intended solely for
the addressee(s) and may contain confidential and/or privileged information and
may be legally protected from disclosure. If you are not the intended recipient
of this message, or if this message has been addressed to you in error, please
immediately alert the sender by reply email and then delete this message and
any attachments. If you are not the intended recipient, you are hereby notified
that any use, dissemination, copying, or storage of this message or its
attachments is strictly prohibited