| Line 135... |
Line 135... |
| 135 |
projection={'thumbnailImageUrl':1}
|
135 |
projection={'thumbnailImageUrl':1}
|
| 136 |
for tag, item in tuples:
|
136 |
for tag, item in tuples:
|
| 137 |
if not catalogMap.has_key(item.catalog_item_id):
|
137 |
if not catalogMap.has_key(item.catalog_item_id):
|
| 138 |
catalogObj = {}
|
138 |
catalogObj = {}
|
| 139 |
catalogObj['title'] = " ".join(filter(None, [item.brand, item.model_name, item.model_number]))
|
139 |
catalogObj['title'] = " ".join(filter(None, [item.brand, item.model_name, item.model_number]))
|
| - |
|
140 |
catalogObj['brand'] = item.brand
|
| 140 |
catalogObj['identifier'] = item.catalog_item_id
|
141 |
catalogObj['identifier'] = item.catalog_item_id
|
| 141 |
catalogObj['items'] = {}
|
142 |
catalogObj['items'] = {}
|
| 142 |
filterMap = {"_id":item.catalog_item_id}
|
143 |
filterMap = {"_id":item.catalog_item_id}
|
| 143 |
#Dont include it catalog not available
|
144 |
#Dont include it catalog not available
|
| 144 |
try:
|
145 |
try:
|
| Line 174... |
Line 175... |
| 174 |
tags = itemMap['tagPricing']
|
175 |
tags = itemMap['tagPricing']
|
| 175 |
for tag in tags:
|
176 |
for tag in tags:
|
| 176 |
itemObj = {'id':('itemtag-%s-%s'%(itemId, tag.tag_id)), 'color_s':itemMap['color'], 'itemId_i': itemId, 'tagId_i':tag.tag_id,
|
177 |
itemObj = {'id':('itemtag-%s-%s'%(itemId, tag.tag_id)), 'color_s':itemMap['color'], 'itemId_i': itemId, 'tagId_i':tag.tag_id,
|
| 177 |
'mop_f': tag.mop, 'sellingPrice_f': tag.selling_price}
|
178 |
'mop_f': tag.mop, 'sellingPrice_f': tag.selling_price}
|
| 178 |
itemObjs.append(itemObj)
|
179 |
itemObjs.append(itemObj)
|
| 179 |
catalogObj = {'id':'catalog' + str(catalogId), 'rank_i':catalogMap['rank'], 'title_s': catalogMap['title'], '_childDocuments_':itemObjs, 'catalogId_i':catalogId, 'imageUrl_s': catalogMap['imageUrl']}
|
180 |
catalogObj = {'id':'catalog' + str(catalogId), 'rank_i':catalogMap['rank'], 'title_s': catalogMap['title'], '_childDocuments_':itemObjs, 'catalogId_i':catalogId, 'imageUrl_s': catalogMap['imageUrl'],
|
| - |
|
181 |
'brand_i': catalogMap['brand']}
|
| 180 |
catalogObjs.append(catalogObj)
|
182 |
catalogObjs.append(catalogObj)
|
| 181 |
solr.delete(q='*:*')
|
183 |
solr.delete(q='*:*')
|
| 182 |
solr.add(catalogObjs)
|
184 |
solr.add(catalogObjs)
|
| 183 |
|
185 |
|
| 184 |
|
186 |
|