cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem with Search result using FlexibleSearchQuery

Former Member
0 Likes
397

Hi, I am using flexisearch query to get a product.

SELECT {p:PK} FROM {Product as p} where {p.code}=?productCode

I am passing product code as the parameter. [ query parameters: [{productCode=6666852}]

I am getting null value in the result set in the code. But When I use the same flexi search in HAC, I am getting the result.

What would the issue? Please help me on this.

Thanks,

Vinod.

Accepted Solutions (1)

Accepted Solutions (1)

arvind-kumar_avinash
Active Contributor
0 Likes

It can be because of some restriction. Please use the following code to test if the product is available to admin and then you can check your requirement for the restriction.

 ...
 import de.hybris.platform.servicelayer.user.UserService;
 ...
 @Autowired
 private UserService userService;
 ...
 userService.setCurrentUser(userService.getAdminUser())
 ...

Please refer https://help.hybris.com/1808/hcd/8c428f8286691014970ceee87aa01605.html for more information.

Answers (0)