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 heaven <ah...@gmail.com> on 2014/01/14 20:20:08 UTC

Re: Query time join with conditions

Can someone shed some light on this?



--
View this message in context: http://lucene.472066.n3.nabble.com/Query-time-join-with-conditions-tp4108365p4111300.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Query time join with conditions

Posted by Kranti Parisa <kr...@gmail.com>.
cool, np.

Thanks,
Kranti K. Parisa
http://www.linkedin.com/in/krantiparisa



On Thu, Jan 16, 2014 at 11:30 AM, heaven <ah...@gmail.com> wrote:

> Nvm, figured it out.
>
> To match profiles that have "test entry" in own attributes or in related
> rss
> entries it is possible to use ({!join from=profile_ids_im to=id_i
> v=$rssQuery}Test entry) OR Test entry in "q" parameter, not in "fq".
>
> Thanks again for the help,
> Alex
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Query-time-join-with-conditions-tp4108365p4111719.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Query time join with conditions

Posted by heaven <ah...@gmail.com>.
Nvm, figured it out.

To match profiles that have "test entry" in own attributes or in related rss
entries it is possible to use ({!join from=profile_ids_im to=id_i
v=$rssQuery}Test entry) OR Test entry in "q" parameter, not in "fq".

Thanks again for the help,
Alex



--
View this message in context: http://lucene.472066.n3.nabble.com/Query-time-join-with-conditions-tp4108365p4111719.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Query time join with conditions

Posted by heaven <ah...@gmail.com>.
Hi, thanks for the response. Seems almost figured things out.

Since both Profiles and RssEntries are in the same index (same core), it is
possible to either use `v=` param or specify `type:RssEntry` right after the
closing `}`. Both will work:
{!join from=profile_ids_im to=id_i}type:RssEntry
or
{!join from=profile_ids_im to=id_i v=$rssQuery}&rssQuery=(type:RssEntry)

But there are a few side effects:
1. This query will filter out all profiles that do not have RssEntries,
which is not desired in my case. I simply need to look if profile's or one
of related rss entries' content includes certain words. Like a LEFT JOIN,
but getting INNER JOIN instead.
2. Not clear to me how to use fulltext search on joined rss entries. This
query does not work for me:
 * There's one profile with rss entry: http://oi39.tinypic.com/2i91mir.jpg
 * But search by rss entry text field does not work:
http://oi42.tinypic.com/sfywex.jpg
 * But an rss entry with "Test entry" content exists:
http://oi41.tinypic.com/2j5gm6s.jpg

Is there any way to perform a left join operation, so profiles without rss
entries will not be lost? Or to use the OR operator to match both profiles
that have "test entry" content AND profiles which own rss entry that has
"test entry" content?

Thanks in advance,
Alex



--
View this message in context: http://lucene.472066.n3.nabble.com/Query-time-join-with-conditions-tp4108365p4111710.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Query time join with conditions

Posted by Kranti Parisa <kr...@gmail.com>.
you should be able to do the following
/ProfileCore/select?q=*:*&fq={!join fromIndex=RssCore from=profile_id to=id
v=$rssQuery}&rssQuery=(type:'RssEntry')

There is also a new join impl
https://issues.apache.org/jira/browse/SOLR-4787 which allows you to use fq
within join, which will support Nested Joins and obviously hit filter cache.

Thanks,
Kranti K. Parisa
http://www.linkedin.com/in/krantiparisa



On Tue, Jan 14, 2014 at 2:20 PM, heaven <ah...@gmail.com> wrote:

> Can someone shed some light on this?
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Query-time-join-with-conditions-tp4108365p4111300.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>