Hi Erick,

I just didn't know how to handle the logic without using streaming query.
What I want is to apply the logic without streaming expressions.

I want to eliminate "item_name"s in the result set which has any of it's 
record's status='N'

Example:
Id:1, Item Name: A , status: Y
Id:2, Item Name: A,  status: Y
Id:3, Item Name: B,  status: Y
Id:4, Item Name: B,  status: N
Id:5, Item Name: B,  status: Y

For this data, If I apply fq=status:Y -status:N, I would still get Ids: 1,2,3, 
and 5.
I would like to eliminate B completely as it has one record with status:N

Is this possible to do in Solr without using streaming expressions?

-Lewin

-----Original Message-----
From: Erick Erickson [mailto:erickerick...@gmail.com] 
Sent: Tuesday, January 02, 2018 6:34 PM
To: solr-user <solr-user@lucene.apache.org>
Subject: Re: Solr Issue

wait, what is it you want to do? Streaming is built expressly to handle very 
large result sets. It is _not_ really designed to deliver pages at a time. Why 
do you want to use it at all?

Why not just use straight Solr, perhaps with cursorMark if you want to page 
deeply. The query is something like:
q=status:‘N’ -status: ‘Y’
or
q=status:‘N’&fq:-status: ‘Y’

Best,
Erick

On Tue, Jan 2, 2018 at 1:35 PM, Lewin Joy (TMNA) <lewin....@toyota.com> wrote:
> ** PROTECTED 関係者外秘
> Hi,
>
> I am using Solr 6.1 and am facing an issue with a complex scenario.
> Could you help figure out how this can be achieved in Solr?
>
> We have items:  A, B, C . There will be multiple record entries for each 
> items.
> For our understanding, let’s say the fields for these records are: 
> primary_key,item_name,status.
>
> I need to retrieve all records with status= ‘N’ and filter out items which 
> has any of it’s record matching status: ‘Y’
>
> For record set below, the query should only return me records 1 and 2.
> Primary_key
>
> Item_Name
>
> status
>
> 1
>
> A
>
> N
>
> 2
>
> A
>
> N
>
> 3
>
> B
>
> N
>
> 4
>
> B
>
> Y
>
> 5
>
> B
>
> N
>
> 6
>
> C
>
> Y
>
> 7
>
> C
>
> N
>
>
>
> Currently, I am using Streaming Query expressions to do complement() 
> operation.
> But the number of records with status= ‘Y’ is too huge and causes performance 
> Problems.
> And secondly, streaming query exports with Joins and complements can’t be 
> used properly for bringing out paginated outputs.
>
> Is there anyway, we can group the results and do a query on the group to 
> filter out such records?
> Or any other approach which could give my results paginated?
>
> Thanks,
> Lewin

Reply via email to