on 05-20-2019 3:14 PM
I am not able to retrieve categories list for a full text search (for ex: search text "Kitchen" should display all categories with Kitchen word in the category name) I am able to retrieve categories using category code but not with text search.
final CategorySearchEvaluator categorySearch = new CategorySearchEvaluator(categoryCode, searchQuery, page, showMode,
sortCode, categoryPage);
ProductCategorySearchPageData<SearchStateData, ProductData, CategoryData> searchPageData = null;
try
{
categorySearch.doSearch();
searchPageData = categorySearch.getSearchPageData();
}
catch (final ConversionException e) // NOSONAR
{
searchPageData = createEmptySearchResult(categoryCode);
}
searchPageData.getSubCategories();
Defaultly its subCategories, You can define your own attribute allCategories and add the populator as follow.
public class MyProductCategorySearchPagePopulator implements Populator, ProductCategorySearchPageData> {
/*
* (non-Javadoc)
*
* @see de.hybris.platform.converters.Populator#populate(ProductCategorySearchPageData<QUERY, RESULT, SCAT,
* ProductCategorySearchPageData<STATE, ITEM, CATEGORY>)
*/
@Override
public void populate(final ProductCategorySearchPageData<QUERY, RESULT, SCAT> source,
final ProductCategorySearchPageData<STATE, ITEM, CATEGORY> target) throws ConversionException
{
if (source.getAllCategories() != null)
{
target.setAllCategories(source.getAllCategories());
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.