Skip to Content
0
Feb 02, 2018 at 10:24 AM

Query an unapproved product from flexible search

361 Views

Hi Team,

I have a custom many --> many relation between product -- > product, which is used to store replaced and replaced by products.

Let me say product B replaced A and A is marked as unapproved in hybris after sometime. When customer searches for A in the portal, i should return B.

I see that the below query if i run in HAC, giving product models from source/ target, though the product is unapproved. But i am not getting the result if i do it programatically with flexible search.

Can someone explain why so ?? and how can i get unapproved products with flexible search ?

query :

select {rel.source} from {PartsHistoryRelation as rel} where {rel.target} = ({{ select {pk} from {product} where {code} = ?code }})

code value : 'A'

Regards, Sandeep