on ‎2018 Feb 24 7:42 AM
How to convert searchResult to ArrayList
String query = "SELECT * FROM {PRODUCT}"
final FlexibleSearchQuery fQuery = new FlexibleSearchQuery(query);
SearchResult<ProductModel> products = flexibleSearchService.search(fQuery);
I want to convert to List. Any Idea?
Request clarification before answering.
Thanks
I got the Answer
String query = "SELECT {pk} FROM {PRODUCT}"
final FlexibleSearchQuery fQuery = new FlexibleSearchQuery(query);
SearchResult result= flexibleSearchService.search(fQuery);
List products = result.getResult();
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
products.getResult() will get all product.
Hope it will help you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ansari,
Please use below piece of code,
String query = "SELECT {pk} FROM {PRODUCT}"
final FlexibleSearchQuery fQuery = new FlexibleSearchQuery(query);
List<ProductModel> products = flexibleSearchService.search(fQuery).getResult();
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 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.