Skip to Content
Former Member
Sep 19, 2017 at 07:51 AM

Flexible search query for Country returns nothing but HAC provides value for same country


Hi Experts,

I have a flexible search query in my java class where I am getting country model based on country name.

final FlexibleSearchQuery searchQuery = new FlexibleSearchQuery("SELECT {pk} FROM {Country} WHERE {name} = ?name"); searchQuery.addQueryParameter("name", countryName); final CountryModel country = flexibleSearchService.searchUnique(searchQuery);

I get exception for country China like 'de.hybris.platform.servicelayer.exceptions.ModelNotFoundException: No result for the given query', but when I execute the same query in HAC, I am getting result for China.

Can anyone please let me know, what might be the issue ?

Regards, Lavanya K