Skip to Content
0
Former Member
May 03, 2016 at 09:22 AM

Flexible Search missing value exception while running the query

851 Views

When I am trying to query an Items using below query

Select {b2bcustomer.pk} from {SoldToB2BUnit AS soldTo JOIN PrincipalGroupRelation AS relation ON {relation.target}={soldTo.PK} JOIN B2BCustomer AS b2bcustomer ON {relation.source}={b2bcustomer.pk} } where {soldTo.UID} LIKE CONCAT(?soldTo, '%')

getting below exception

de.hybris.platform.servicelayer.search.exceptions.FlexibleSearchException: missing values for [soldTo], got {13=8796096790610, 11=8796095742034}

but when i run the same using HAC, getting the expected output.

Code for the same is as below

buf.append("Select {b2bcustomer.pk} from {SoldToB2BUnit AS soldTo JOIN PrincipalGroupRelation AS relation ON {relation.target}={soldTo.PK} JOIN B2BCustomer AS b2bcustomer ON {relation.source}={b2bcustomer.pk} } where {soldTo.UID} LIKE CONCAT(?soldTo, '%')");

     final FlexibleSearchQuery query = new FlexibleSearchQuery(buf.toString());
     query.addQueryParameter("soldTo ", soldToId);
     final List<CustomerModel> suggestedUsers = new ArrayList<CustomerModel>(getFlexibleSearchService().<CustomerModel> search(
             query).getResult());

Anything i am missing here ?