Hi Joel, sorry I missed your reply. Let me explain again my problem
statement as I don't think JOIN can help here unless I am not able to read
your mind :). What I am looking for is to substitute output from one
stream and use it as a filter query value in another stream; not really the
key match which happens in joins.
e.g. If I have a filters collection and assume its returns below tuple with
filter field
select(
search(filters,
q="*:*",
fq="key:84396",
qt="/export",
fl="id,filter1_s,key",
sort="key asc"
),
filter1_s as filter)
outputs
{
"result-set": {
"docs": [
{
"filter": "division_s:(A B C)"
},
{
"EOF": true,
"RESPONSE_TIME": 4
}
]
}
}
And I want to use / substitute the value of the filter field which is
"division_s:(A B C)" and apply to fq in the below streaming statement which
is querying emp collection. How can I achieve both in one streaming
expression ?
search(emp,
q="*:*",
fq="division_s:(A B C)",
qt="/export",
fl="id,name",
df="_text_",
sort="id asc")
Appreciate your help. Thank you.
On Mon, Aug 22, 2022 at 12:12 PM Joel Bernstein <[email protected]> wrote:
> If the sorts of the two streams are not the same you can use the hashJoin:
>
> https://solr.apache.org/guide/8_4/stream-decorator-reference.html#hashjoin
>
> Joel Bernstein
> http://joelsolr.blogspot.com/
>
>
> On Mon, Aug 22, 2022 at 12:00 PM Joel Bernstein <[email protected]>
> wrote:
>
> > I believe what you're looking for is an innerJoin:
> >
> >
> https://solr.apache.org/guide/8_4/stream-decorator-reference.html#innerjoin
> >
> >
> >
> > Joel Bernstein
> > http://joelsolr.blogspot.com/
> >
> >
> > On Wed, Aug 17, 2022 at 12:47 PM Susheel Kumar <[email protected]>
> > wrote:
> >
> >> Hello,
> >>
> >> How can we substitute an output from a streaming expr as a filter query
> >> inside another streaming expression. For example below expr
> >>
> >> select(
> >> search(filters,
> >> q="*:*",
> >> fq="key:84396",
> >> qt="/export",
> >> fl="id,filter1_s,key",
> >> sort="key asc"
> >> ),
> >> filter1_s as filter)
> >>
> >> outputs
> >>
> >> { "result-set": { "docs": [ { "filter": "division_s:(A B C)" }, { "EOF":
> >> true, "RESPONSE_TIME": 4 } ] } }
> >>
> >> and then how can apply the above filter value to below expr at runtime ?
> >> OR
> >> How can we combine both below and above expressions and run as a single
> >> streaming expression.
> >> search(emp,
> >> q="*:*",
> >> fq=*"division_s:(A B C)"*,
> >> qt="/export",
> >> fl="id,name",
> >> df="_text_",
> >> sort="id asc")
> >> Thanks,
> >> Susheel
> >>
> >
>