Subversion Repositories SmartDukaan

Rev

Rev 31746 | Rev 33458 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
31604 tejbeer 1
package com.spice.profitmandi.dao.service.solr;
2
 
33245 ranu 3
import com.google.gson.Gson;
4
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
5
import com.spice.profitmandi.dao.entity.catalog.TagListing;
6
import com.spice.profitmandi.dao.entity.catalog.TagRanking;
7
import com.spice.profitmandi.dao.entity.dtr.WebProductListing;
8
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
9
import com.spice.profitmandi.dao.repository.catalog.TagRankingRepository;
10
import com.spice.profitmandi.dao.repository.dtr.Mongo;
11
import com.spice.profitmandi.dao.repository.dtr.WebListingRepository;
12
import com.spice.profitmandi.dao.repository.dtr.WebProductListingRepository;
13
import com.spice.profitmandi.service.tag.ItemTagModel;
14
import in.shop2020.model.v1.catalog.status;
31604 tejbeer 15
import org.apache.logging.log4j.LogManager;
16
import org.apache.logging.log4j.Logger;
17
import org.apache.solr.client.solrj.SolrClient;
18
import org.apache.solr.client.solrj.impl.HttpSolrClient;
19
import org.apache.solr.common.SolrInputDocument;
20
import org.json.JSONArray;
21
import org.json.JSONException;
22
import org.json.JSONObject;
23
import org.springframework.beans.factory.annotation.Autowired;
31613 tejbeer 24
import org.springframework.beans.factory.annotation.Value;
31604 tejbeer 25
import org.springframework.stereotype.Component;
26
 
33245 ranu 27
import java.io.BufferedReader;
28
import java.io.IOException;
29
import java.io.InputStream;
30
import java.io.InputStreamReader;
31
import java.net.HttpURLConnection;
32
import java.net.URL;
33
import java.net.URLConnection;
34
import java.time.ZoneId;
35
import java.util.*;
36
import java.util.Map.Entry;
37
import java.util.stream.Collectors;
38
import java.util.zip.GZIPInputStream;
31604 tejbeer 39
 
40
@Component
41
public class FofoSolr {
42
 
43
	@Autowired
44
	private Gson gson;
45
 
46
	@Autowired
47
	private TagListingRepository tagListingRepository;
48
 
49
	@Autowired
50
	TagRankingRepository tagRankingRepository;
51
 
52
	@Autowired
53
	private Mongo contentMongoClient;
54
 
31612 tejbeer 55
	@Autowired
56
	private WebListingRepository webListingRepository;
57
 
58
	@Autowired
59
	private WebProductListingRepository webProductListingRepository;
60
 
31613 tejbeer 61
	@Value("${new.solr.url}")
62
	private String solrUrl;
63
 
31604 tejbeer 64
	private static final Logger logger = LogManager.getLogger(FofoSolr.class);
65
 
66
	private static final List<Integer> CATEGORY_MASTER = Arrays.asList(10006, 10010, 14202, 14203);
67
 
31623 tejbeer 68
	String solrPath = "http://" + "50.116.10.120" + ":8984/solr/demo";
31604 tejbeer 69
	String mongoHost = "localhost";
70
	SolrClient solr = new HttpSolrClient.Builder(solrPath).build();
71
 
72
	private String getAvailabilityJSON() {
73
		String url = "http://50.116.10.120/reports/run.php?execute_mode=EXECUTE&xmlin=warehousecisnew.xml&project=FOCOR&project_password=focor&target_format=JSON";
74
		return getUrlContent(url);
75
	}
76
 
77
	private String getPendingPOJSON() {
78
		String url = "http://50.116.10.120/reports/run.php?execute_mode=EXECUTE&xmlin=UnfulfilledPOItemsNew.xml&project=FOCOR&project_password=focor&target_format=JSON";
79
		return getUrlContent(url);
80
	}
81
 
82
	private static String getUrlContent(String urlString) {
83
		BufferedReader reader = null;
84
		try {
85
			URL url = new URL(urlString);
86
			URLConnection conn = url.openConnection();
87
			conn.setConnectTimeout(5000);
88
			conn.setReadTimeout(5000);
89
			reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
90
			return reader.lines().collect(Collectors.joining(System.lineSeparator()));
91
		} catch (IOException e) {
92
			e.printStackTrace();
93
		} finally {
94
			if (reader != null) {
95
				try {
96
					reader.close();
97
				} catch (IOException e) {
98
					e.printStackTrace();
99
				}
100
			}
101
		}
102
		return null;
103
	}
104
 
105
	public JSONArray getAvailability() throws IOException, JSONException {
106
		String url = "http://50.116.10.120/reports/run.php?execute_mode=EXECUTE&xmlin=warehousecisnew.xml&project=FOCOR&project_password=focor&target_format=JSON";
107
		HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
108
		connection.setRequestProperty("Accept-Encoding", "gzip");
109
		BufferedReader reader = null;
110
 
111
		try {
112
			InputStream inputStream = connection.getInputStream();
113
 
114
			if ("gzip".equals(connection.getContentEncoding())) {
115
				inputStream = new GZIPInputStream(inputStream);
116
			}
117
 
118
			reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
119
			StringBuilder responseBuilder = new StringBuilder();
120
			String line;
121
 
122
			while ((line = reader.readLine()) != null) {
123
				responseBuilder.append(line);
124
			}
125
 
126
			JSONObject responseJson = new JSONObject(responseBuilder.toString());
127
			return responseJson.getJSONArray("data");
128
		} finally {
129
			if (reader != null) {
130
				try {
131
					reader.close();
132
				} catch (IOException e) {
133
					// Ignore
134
				}
135
			}
136
		}
137
	}
138
 
139
	public JSONArray getPendingPO() throws IOException, JSONException {
140
		String url = "http://50.116.10.120/reports/run.php?execute_mode=EXECUTE&xmlin=UnfulfilledPOItemsNew.xml&project=FOCOR&project_password=focor&target_format=JSON";
141
		HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
142
		connection.setRequestProperty("Accept-Encoding", "gzip");
143
		BufferedReader reader = null;
144
 
145
		try {
146
			InputStream inputStream = connection.getInputStream();
147
 
148
			if ("gzip".equals(connection.getContentEncoding())) {
149
				inputStream = new GZIPInputStream(inputStream);
150
			}
151
 
152
			reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
153
			StringBuilder responseBuilder = new StringBuilder();
154
			String line;
155
 
156
			while ((line = reader.readLine()) != null) {
157
				responseBuilder.append(line);
158
			}
159
 
160
			JSONObject responseJson = new JSONObject(responseBuilder.toString());
161
			return responseJson.getJSONArray("data");
162
		} finally {
163
			if (reader != null) {
164
				try {
165
					reader.close();
166
				} catch (IOException e) {
167
					// Ignore
168
				}
169
			}
170
		}
171
	}
172
 
173
	public Map<String, Map<String, Map<String, Integer>>> getItemMap() throws Exception {
174
		JSONArray availabilityJSONArray = this.getAvailability();
175
		JSONArray pendingPOJSONArray = this.getPendingPO();
176
		Map<String, Map<String, Map<String, Integer>>> availabilityItemMap = new HashMap<>();
177
 
178
		for (int i = 0; i < availabilityJSONArray.length(); i++) {
179
			JSONObject rawAvailability = availabilityJSONArray.getJSONObject(i);
180
			if (!availabilityItemMap.containsKey(rawAvailability.getString("Itemid"))) {
181
				availabilityItemMap.put(rawAvailability.getString("Itemid"),
182
						new HashMap<String, Map<String, Integer>>());
183
			}
184
			if (!availabilityItemMap.get(rawAvailability.getString("Itemid"))
185
					.containsKey(rawAvailability.getString("Warehouseid"))) {
186
				availabilityItemMap.get(rawAvailability.getString("Itemid"))
187
						.put(rawAvailability.getString("Warehouseid"), new HashMap<String, Integer>());
188
				availabilityItemMap.get(rawAvailability.getString("Itemid"))
189
						.get(rawAvailability.getString("Warehouseid")).put("netAvailability", 0);
190
				availabilityItemMap.get(rawAvailability.getString("Itemid"))
191
						.get(rawAvailability.getString("Warehouseid")).put("netPo", 0);
192
			}
193
			int netAvailability = availabilityItemMap.get(rawAvailability.getString("Itemid"))
194
					.get(rawAvailability.getString("Warehouseid")).get("netAvailability")
195
					+ rawAvailability.getInt("Netavailability");
196
			availabilityItemMap.get(rawAvailability.getString("Itemid")).get(rawAvailability.getString("Warehouseid"))
197
					.put("netAvailability", netAvailability);
198
		}
199
 
200
		for (int i = 0; i < pendingPOJSONArray.length(); i++) {
201
			JSONObject rawPendingPo = pendingPOJSONArray.getJSONObject(i);
202
 
203
			String itemId = rawPendingPo.getString("Itemid");
204
			String warehouseId = rawPendingPo.getString("Warehouseid");
205
			if (!availabilityItemMap.containsKey(itemId)) {
206
				availabilityItemMap.put(itemId, new HashMap<String, Map<String, Integer>>());
207
			}
208
			if (!availabilityItemMap.get(itemId).containsKey(warehouseId)) {
209
				availabilityItemMap.get(itemId).put(warehouseId, new HashMap<String, Integer>() {
210
					{
211
						put("netAvailability", 0);
212
						put("netPo", 0);
213
					}
214
				});
215
			}
216
			availabilityItemMap.get(itemId).get(warehouseId).put("netPo",
217
					availabilityItemMap.get(itemId).get(warehouseId).get("netPo") + rawPendingPo.getInt("Unfulfilled"));
218
 
219
		}
220
		return availabilityItemMap;
221
 
222
	}
223
 
33245 ranu 224
    public Map<Integer, List<String>> getLabels() throws ProfitMandiBusinessException {
31634 tejbeer 225
		List<String> labels = Arrays.asList("partner-best-sellers", "partner-price-drop", "new-launches",
226
				"upgrade-offer", "special-support");
31612 tejbeer 227
 
228
		Map<Integer, String> webListing = webListingRepository.selectByUrls(labels).stream()
229
				.collect(Collectors.toMap(x -> x.getId(), x -> x.getUrl()));
230
 
231
		Map<Integer, List<WebProductListing>> webProductListingMap = webProductListingRepository
232
				.selectAllByWebListingIds(new ArrayList<>(webListing.keySet())).stream()
233
				.collect(Collectors.groupingBy(x -> x.getWebListingId()));
234
 
235
		Map<Integer, List<String>> catalogLabelMap = new HashMap<>();
236
		for (Entry<Integer, List<WebProductListing>> webProductListingEntry : webProductListingMap.entrySet()) {
237
 
238
			for (WebProductListing webProduct : webProductListingEntry.getValue()) {
239
 
240
				if (!catalogLabelMap.containsKey(webProduct.getEntityId())) {
241
 
242
					catalogLabelMap.put(webProduct.getEntityId(), new ArrayList<>());
243
 
244
				}
245
 
246
				List<String> itemLabels = catalogLabelMap.get(webProduct.getEntityId());
247
				itemLabels.add(webListing.get(webProduct.getWebListingId()));
248
				catalogLabelMap.put(webProduct.getEntityId(), itemLabels);
249
 
250
			}
251
 
252
		}
253
 
254
		return catalogLabelMap;
255
	}
256
 
31620 tejbeer 257
	public void populateTagItems() throws Exception {
31604 tejbeer 258
		Map<String, Map<String, Map<String, Integer>>> availabilityItemMap = getItemMap();
259
		List<TagRanking> tagRankingList = tagRankingRepository.getAllTagRanking();
260
		List<Integer> rankingList = new ArrayList<>();
261
		Map<Integer, String> featureMap = new HashMap<>();
262
		for (TagRanking tagRanking : tagRankingList) {
263
			rankingList.add(tagRanking.getCatalogItemId());
264
			featureMap.put(tagRanking.getCatalogItemId(), tagRanking.getFeature());
265
		}
266
		Map<Integer, Map<String, Object>> catalogMap = new HashMap<>();
267
 
31612 tejbeer 268
		List<status> statuses = Arrays.asList(status.ACTIVE, status.PAUSED_BY_RISK, status.PARTIALLY_ACTIVE);
269
 
270
		Map<Integer, List<String>> catalogLabelMap = this.getLabels();
271
 
272
		logger.info("catalogLabelMap {}", catalogLabelMap);
273
 
274
		/*
275
		 * List<ItemTagModel> tuples =
276
		 * tagListingRepository.getAllItemTagByStatus(statuses).stream() .filter(x ->
277
		 * x.getItem().getCatalogItemId() == 1023747).collect(Collectors.toList());
278
		 */
279
 
31604 tejbeer 280
		List<ItemTagModel> tuples = tagListingRepository.getAllItemTagByStatus(statuses);
281
 
282
		Map<String, Object> projection = new HashMap<>();
283
		projection.put("defaultImageUrl", 1);
284
 
31710 tejbeer 285
		List<String> excludeBrands = Arrays.asList("Dummy", "FOC HANDSET");
31604 tejbeer 286
 
287
		for (ItemTagModel result : tuples) {
288
			TagListing tag = result.getTagListing();
289
			com.spice.profitmandi.dao.entity.catalog.Item item = result.getItem();
290
			if (excludeBrands.contains(item.getBrand())) {
291
				continue;
292
			}
293
 
294
			if (!catalogMap.containsKey(item.getCatalogItemId())) {
295
				Map<String, Object> catalogObj = new HashMap<>();
296
				catalogObj.put("feature", "");
31641 tejbeer 297
				catalogObj.put("hsnCode", item.getHsnCode());
31604 tejbeer 298
				catalogObj.put("title",
299
						String.join(" ", Arrays.asList(item.getBrand(), item.getModelName(), item.getModelNumber())
300
								.stream().filter(s -> s != null && !s.isEmpty()).collect(Collectors.toList())));
31612 tejbeer 301
				catalogObj.put("brand", new String[] { item.getBrand() });
31604 tejbeer 302
				if (item.getBrand().equals("Huawei") || item.getBrand().equals("Honor")) {
303
					catalogObj.put("brand", new String[] { "Huawei", "Honor" });
304
				}
305
				if (item.getBrand().equals("Mi") || item.getBrand().equals("Xiaomi")
306
						|| item.getBrand().equals("Redmi")) {
307
					catalogObj.put("brand", new String[] { "Mi", "Xiaomi", "Redmi" });
308
				}
309
				catalogObj.put("identifier", item.getCatalogItemId());
310
				catalogObj.put("items", new HashMap<Integer, Map<String, Object>>());
311
				Map<String, Object> filterMap = new HashMap<>();
312
				filterMap.put("_id", item.getCatalogItemId());
313
				// Don't include if catalog not available
314
				try {
31620 tejbeer 315
					String imageUrl = contentMongoClient.getEntityById(item.getCatalogItemId()).getDefaultImageUrl();
31604 tejbeer 316
 
31620 tejbeer 317
					if (imageUrl != null) {
318
						catalogObj.put("imageUrl", imageUrl);
319
					} else {
320
						catalogObj.put("imageUrl",
321
								"https://images.smartdukaan.com/uploads/campaigns/" + item.getCatalogItemId() + ".jpg");
322
					}
31604 tejbeer 323
				} catch (Exception e) {
324
					try {
325
						catalogObj.put("imageUrl",
326
								"https://images.smartdukaan.com/uploads/campaigns/" + item.getCatalogItemId() + ".jpg");
327
					} catch (Exception e2) {
328
						e2.printStackTrace();
329
					}
330
				}
331
				try {
332
					catalogObj.put("rank", rankingList.indexOf(item.getCatalogItemId()));
333
				} catch (Exception e) {
334
					// A very big number
335
					e.printStackTrace();
336
					catalogObj.put("rank", 50000000);
337
				}
338
				if (featureMap.containsKey(item.getCatalogItemId())
339
						&& featureMap.get(item.getCatalogItemId()) != null) {
340
					catalogObj.put("feature", featureMap.get(item.getCatalogItemId()));
341
 
342
				}
343
 
31634 tejbeer 344
				catalogObj.put("categoryId", CATEGORY_MASTER.contains(item.getCategoryId()) ? item.getCategoryId() : 6);
31624 tejbeer 345
 
31604 tejbeer 346
				if (item.getCategoryId() == 10006) {
347
					catalogObj.put("categoryId", 3);
348
				}
349
				catalogObj.put("subCategoryId", item.getCategoryId());
31612 tejbeer 350
				catalogObj.put("create_timestamp",
351
						tag.getCreatedTimestamp().atZone(ZoneId.systemDefault()).toInstant().toEpochMilli());
352
 
353
				if (catalogLabelMap.containsKey(item.getCatalogItemId())
354
						&& catalogLabelMap.get(item.getCatalogItemId()) != null) {
355
					catalogObj.put("labels", catalogLabelMap.get(item.getCatalogItemId()));
356
 
357
				}
31604 tejbeer 358
				catalogMap.put(item.getCatalogItemId(), catalogObj);
359
				catalogObj.put("avColor", new HashMap<>());
31612 tejbeer 360
 
31604 tejbeer 361
			}
362
 
363
			Map<String, Object> catalogObj = catalogMap.get(item.getCatalogItemId());
364
			Map<Integer, Integer> avColorMap = (Map<Integer, Integer>) catalogObj.get("avColor");
365
 
366
			if (availabilityItemMap.containsKey(String.valueOf(item.getId()))) {
367
				for (Map.Entry<String, Map<String, Integer>> entry : availabilityItemMap
368
						.get(String.valueOf(item.getId())).entrySet()) {
369
					String warehouseId = entry.getKey();
370
					Map<String, Integer> avMap = entry.getValue();
371
					if (!avColorMap.containsKey(Integer.parseInt(warehouseId))) {
372
						avColorMap.put(Integer.parseInt(warehouseId), 0);
373
					}
374
					int color = avColorMap.get(Integer.parseInt(warehouseId));
375
 
376
					if (avMap.get("netAvailability") > 0) {
377
						color = 2;
378
					} else if (avMap.get("netAvailability") + avMap.get("netPo") > 0) {
379
						color = Math.max(color, 1);
380
					} else {
381
						color = Math.max(color, 0);
382
					}
383
					avColorMap.put(Integer.parseInt(warehouseId), color);
384
 
385
					catalogObj.put("avColor", avColorMap);
386
 
387
				}
388
 
389
			}
390
 
391
			Map<Integer, Object> itemColorMap = (Map<Integer, Object>) catalogObj.get("items");
392
 
393
			if (!itemColorMap.containsKey(item.getId())) {
394
				itemColorMap.put(item.getId(), new HashMap<String, Object>() {
395
					{
396
						put("color", item.getColor().replace("f_", ""));
397
						put("tagPricing", new ArrayList<TagListing>());
398
					}
399
				});
400
			}
401
			Map<String, Object> itemMap = (Map<String, Object>) itemColorMap.get(item.getId());
402
			List<TagListing> tagPricing = (List<TagListing>) itemMap.get("tagPricing");
403
			tagPricing.add(tag);
404
		}
405
 
406
		logger.info("catalogObj {}", catalogMap);
407
		List<SolrInputDocument> catalogSolrObjs = new ArrayList<>();
408
		for (Entry<Integer, Map<String, Object>> entry : catalogMap.entrySet()) {
409
			int catalogId = entry.getKey();
410
			Map<String, Object> catalogValMap = entry.getValue();
411
			Map<Integer, Object> itemsMap = (Map<Integer, Object>) catalogValMap.get("items");
412
 
413
			boolean active = false;
414
			// Map<Integer, Object> itemsMap = (Map<String, Object>)
415
			// catalogValMap.get("items");
416
			List<SolrInputDocument> itemObjs = new ArrayList<>();
417
			float mop = 0;
418
 
419
			for (Entry<Integer, Object> itemEntry : itemsMap.entrySet()) {
420
				int itemId = itemEntry.getKey();
421
				Map<String, Object> itemMap = (Map<String, Object>) itemEntry.getValue();
422
				List<TagListing> tags = (List<TagListing>) itemMap.get("tagPricing");
423
				SolrInputDocument itemObj = new SolrInputDocument();
424
 
425
				for (TagListing taglist : tags) {
426
					active = active || (Boolean) taglist.isActive();
427
					itemObj.setField("id", "itemtag-" + itemId + "-" + taglist.getTagId());
428
					itemObj.setField("color_s", itemMap.get("color"));
429
					itemObj.setField("itemId_i", itemId);
430
					itemObj.setField("tagId_i", taglist.getTagId());
431
					itemObj.setField("mrp_f", taglist.getMrp());
432
					itemObj.setField("mop_f", taglist.getMop());
433
					itemObj.setField("sellingPrice_f", taglist.getSellingPrice());
434
					itemObj.setField("active_b", taglist.isActive());
435
					itemObj.setField("hot_deal_b", taglist.isHotDeals());
436
					mop = taglist.getMop();
437
 
438
				}
439
 
440
				itemObjs.add(itemObj);
441
			}
442
 
443
			logger.info("catalogValMap {}", catalogValMap);
444
 
445
			logger.info("rank {}", catalogValMap.get("rank"));
446
 
447
			SolrInputDocument catalogSolrObj = new SolrInputDocument();
448
 
449
			catalogSolrObj.setField("id", "catalog" + catalogId);
450
			catalogSolrObj.setField("rank_i", catalogValMap.get("rank"));
451
			catalogSolrObj.setField("title_s", catalogValMap.get("title"));
31612 tejbeer 452
			// catalogSolrObj.setField("_childDocuments_", itemObjs);
31604 tejbeer 453
			catalogSolrObj.addChildDocuments(itemObjs);
31616 tejbeer 454
			catalogSolrObj.setField("child_b", itemObjs.size() > 0);
31604 tejbeer 455
			catalogSolrObj.setField("catalogId_i", catalogId);
456
			catalogSolrObj.setField("imageUrl_s",
457
					catalogValMap.get("imageUrl").toString().replace("saholic", "smartdukaan"));
458
			catalogSolrObj.setField("feature_s", catalogValMap.get("feature"));
459
			catalogSolrObj.setField("brand_ss", catalogValMap.get("brand"));
460
			catalogSolrObj.setField("create_s", catalogValMap.get("create_timestamp"));
461
			catalogSolrObj.setField("categoryId_i", catalogValMap.get("categoryId"));
462
			catalogSolrObj.setField("subCategoryId_i", catalogValMap.get("subCategoryId"));
31612 tejbeer 463
			catalogSolrObj.setField("label_ss", catalogValMap.get("labels"));
31604 tejbeer 464
			catalogSolrObj.setField("w7573_i", 0);
465
			catalogSolrObj.setField("w7678_i", 0);
466
			catalogSolrObj.setField("w7720_i", 0);
467
			catalogSolrObj.setField("w8468_i", 0);
468
			catalogSolrObj.setField("w8889_i", 0);
469
			catalogSolrObj.setField("w8947_i", 0);
470
			catalogSolrObj.setField("w9213_i", 0);
471
			catalogSolrObj.setField("w9203_i", 0);
472
			catalogSolrObj.setField("mop_f", mop);
31641 tejbeer 473
			catalogSolrObj.setField("hsncode_s", catalogValMap.get("hsnCode"));
31660 tejbeer 474
			catalogSolrObj.setField("show_default_b", true);
31612 tejbeer 475
 
476
			String[] brands = (String[]) catalogValMap.get("brand");
477
			for (String brand : brands) {
31660 tejbeer 478
				if (brand.equals("FOC")) {
479
					catalogSolrObj.setField("show_default_b", false);
31612 tejbeer 480
 
481
				}
31710 tejbeer 482
 
483
				if (brand.equals("Live Demo")) {
484
					catalogSolrObj.setField("show_default_b", false);
485
 
486
				}
31612 tejbeer 487
			}
31604 tejbeer 488
			Map<Integer, Integer> avColorMap = (Map<Integer, Integer>) catalogValMap.get("avColor");
489
 
490
			for (Entry<Integer, Integer> avColorEntry : avColorMap.entrySet()) {
491
				int whId = avColorEntry.getKey();
492
				int color = (int) avColorEntry.getValue();
493
				catalogSolrObj.setField("w" + whId + "_i", color);
494
			}
495
			catalogSolrObj.setField("active_b", active);
496
			logger.info("catalogSolrObj {}", catalogSolrObj.get("rank_i"));
497
			catalogSolrObjs.add(catalogSolrObj);
498
 
499
		}
500
 
501
		logger.info("catalogSolrObjs {}", catalogSolrObjs);
502
		solr.deleteByQuery("*:*");
503
		solr.add(catalogSolrObjs);
504
 
31612 tejbeer 505
		org.apache.solr.client.solrj.response.UpdateResponse updateResponse = solr.commit();
31604 tejbeer 506
		logger.info("solr {}", updateResponse.getStatus());
507
 
508
	}
509
 
510
	public void pushData() throws Exception {
511
		this.populateTagItems();
512
	}
513
}