on ‎2019 Feb 27 1:22 PM
Here my requirement getting ProductData insted of Product model. Exaple: public Collection getFieldValues(final IndexConfig indexConfig, final IndexedProperty indexedProperty, final Object model) throws FieldValueProviderException { if (model instanceof ProductData) { final ProductData product = (ProductData) model;
But this Code is not working , cal you please suggest how to get ProductData inside the Solr value provider. ?
Request clarification before answering.
No its not possible. Why are you even casting model to data. Value provider works with model and not data. If you need data then convert model to data in your provider and do whatever you want.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Krishna thanks for your answer.
I tried this way but its not working , please validate the code.
public Collection getFieldValues(final IndexConfig indexConfig, final IndexedProperty indexedProperty, final Object model) throws FieldValueProviderException { if (model instanceof ProductData) { final ProductData product = (ProductData) model;
Please suggest me how to get Product data in solr attribute value provider ?
I would suggest that you can use the product converter.
private Converter<ProductModel, ProductData> productConverter;
final ProductModel product = (ProductModel) model;
final ProductData productData = getProductConverter().convert(product .getProduct());
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 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.