| Line 138... |
Line 138... |
| 138 |
}
|
138 |
}
|
| 139 |
for (JsonValue item : suggestion) {
|
139 |
for (JsonValue item : suggestion) {
|
| 140 |
if (count == max_count){
|
140 |
if (count == max_count){
|
| 141 |
break;
|
141 |
break;
|
| 142 |
}
|
142 |
}
|
| 143 |
JsonObject temp = Json.object().add("subCategoryId",item.asObject().get("subCategoryId").asInt()).add("category_id",item.asObject().get("category_id").asInt()).add("title",item.asObject().get("title").asString()).add("category_name",item.asObject().get("category").asString());
|
143 |
JsonObject temp = Json.object().add("subCategoryId",item.asObject().get("subCategoryId").asInt()).add("category_id",item.asObject().get("category_id").asInt()).add("title",item.asObject().get("title").asString()).add("category",item.asObject().get("category").asString());
|
| 144 |
output.add(temp);
|
144 |
output.add(temp);
|
| 145 |
count++;
|
145 |
count++;
|
| 146 |
}
|
146 |
}
|
| 147 |
case 5:
|
147 |
case 5:
|
| 148 |
suggestion = result_json.get("category_id:5").asObject().get("doclist").asObject().get("docs").asArray();
|
148 |
suggestion = result_json.get("category_id:5").asObject().get("doclist").asObject().get("docs").asArray();
|
| Line 155... |
Line 155... |
| 155 |
}
|
155 |
}
|
| 156 |
for (JsonValue item : suggestion) {
|
156 |
for (JsonValue item : suggestion) {
|
| 157 |
if (count == max_count){
|
157 |
if (count == max_count){
|
| 158 |
break;
|
158 |
break;
|
| 159 |
}
|
159 |
}
|
| 160 |
JsonObject temp = Json.object().add("subCategoryId",item.asObject().get("subCategoryId").asInt()).add("category_id",item.asObject().get("category_id").asInt()).add("title",item.asObject().get("title").asString()).add("category_name",item.asObject().get("category").asString());
|
160 |
JsonObject temp = Json.object().add("subCategoryId",item.asObject().get("subCategoryId").asInt()).add("category_id",item.asObject().get("category_id").asInt()).add("title",item.asObject().get("title").asString()).add("category",item.asObject().get("category").asString());
|
| 161 |
output.add(temp);
|
161 |
output.add(temp);
|
| 162 |
count++;
|
162 |
count++;
|
| 163 |
}
|
163 |
}
|
| 164 |
case 6:
|
164 |
case 6:
|
| 165 |
subcat_suggestion = result_json.get("subCategoryId").asObject().get("groups").asArray();
|
165 |
subcat_suggestion = result_json.get("subCategoryId").asObject().get("groups").asArray();
|
| Line 178... |
Line 178... |
| 178 |
count = 0;
|
178 |
count = 0;
|
| 179 |
for (JsonValue item : suggestion) {
|
179 |
for (JsonValue item : suggestion) {
|
| 180 |
if (count == max_count_accesories){
|
180 |
if (count == max_count_accesories){
|
| 181 |
break;
|
181 |
break;
|
| 182 |
}
|
182 |
}
|
| 183 |
JsonObject temp = Json.object().add("subCategoryId",item.asObject().get("subCategoryId").asInt()).add("category_id",item.asObject().get("category_id").asInt()).add("title",item.asObject().get("title").asString()).add("category_name",item.asObject().getString("subCategory", "Accessories"));
|
183 |
JsonObject temp = Json.object().add("subCategoryId",item.asObject().get("subCategoryId").asInt()).add("category_id",item.asObject().get("category_id").asInt()).add("title",item.asObject().get("title").asString()).add("category",item.asObject().getString("subCategory", "Accessories"));
|
| 184 |
output.add(temp);
|
184 |
output.add(temp);
|
| 185 |
count++;
|
185 |
count++;
|
| 186 |
}
|
186 |
}
|
| 187 |
}
|
187 |
}
|
| 188 |
}
|
188 |
}
|