| Line 21... |
Line 21... |
| 21 |
parser.add_option("-d", "--d", dest="dbHost",
|
21 |
parser.add_option("-d", "--d", dest="dbHost",
|
| 22 |
default="127.0.0.1",
|
22 |
default="127.0.0.1",
|
| 23 |
type="string", help="The HOST where the mysql server is running",
|
23 |
type="string", help="The HOST where the mysql server is running",
|
| 24 |
metavar="DBHOST")
|
24 |
metavar="DBHOST")
|
| 25 |
parser.add_option("-s", "--s", dest="solrPath",
|
25 |
parser.add_option("-s", "--s", dest="solrPath",
|
| 26 |
default="http://localhost:8983/solr/demo",
|
26 |
default="http://localhost:8983/solr/demo1",
|
| 27 |
type="string", help="Complete solr path",
|
27 |
type="string", help="Complete solr path",
|
| 28 |
metavar="SOLRHOST")
|
28 |
metavar="SOLRHOST")
|
| 29 |
parser.add_option("-m", "--m", dest="mongoHost",
|
29 |
parser.add_option("-m", "--m", dest="mongoHost",
|
| 30 |
default="localhost",
|
30 |
default="localhost",
|
| 31 |
type="string", help="Complete solr path",
|
31 |
type="string", help="Complete solr path",
|
| Line 142... |
Line 142... |
| 142 |
catalogObj['items'] = {}
|
142 |
catalogObj['items'] = {}
|
| 143 |
filterMap = {"_id":item.catalog_item_id}
|
143 |
filterMap = {"_id":item.catalog_item_id}
|
| 144 |
#Dont include it catalog not available
|
144 |
#Dont include it catalog not available
|
| 145 |
try:
|
145 |
try:
|
| 146 |
catalogObj['imageUrl'] = get_mongo_connection(options.mongoHost).CONTENT.siteContent.find_one(filterMap, projection)['thumbnailImageUrl']
|
146 |
catalogObj['imageUrl'] = get_mongo_connection(options.mongoHost).CONTENT.siteContent.find_one(filterMap, projection)['thumbnailImageUrl']
|
| - |
|
147 |
print catalogObj['imageUrl']
|
| 147 |
except:
|
148 |
except:
|
| 148 |
traceback.print_exc()
|
149 |
traceback.print_exc()
|
| 149 |
continue
|
150 |
continue
|
| 150 |
try:
|
151 |
try:
|
| 151 |
catalogObj['rank'] = tagRankingList.index(item.catalog_item_id)
|
152 |
catalogObj['rank'] = tagRankingList.index(item.catalog_item_id)
|
| Line 175... |
Line 176... |
| 175 |
itemObj = {'id':('itemtag-%s-%s'%(itemId, tag.tag_id)), 'color_s':itemMap['color'], 'itemId_i': itemId, 'tagId_i':tag.tag_id,
|
176 |
itemObj = {'id':('itemtag-%s-%s'%(itemId, tag.tag_id)), 'color_s':itemMap['color'], 'itemId_i': itemId, 'tagId_i':tag.tag_id,
|
| 176 |
'mop_f': tag.mop, 'sellingPrice_f': tag.selling_price}
|
177 |
'mop_f': tag.mop, 'sellingPrice_f': tag.selling_price}
|
| 177 |
itemObjs.append(itemObj)
|
178 |
itemObjs.append(itemObj)
|
| 178 |
catalogObj = {'id':'catalog' + str(catalogId), 'rank_i':catalogMap['rank'], 'title_s': catalogMap['title'], '_childDocuments_':itemObjs, 'catalogId_i':catalogId}
|
179 |
catalogObj = {'id':'catalog' + str(catalogId), 'rank_i':catalogMap['rank'], 'title_s': catalogMap['title'], '_childDocuments_':itemObjs, 'catalogId_i':catalogId}
|
| 179 |
catalogObjs.append(catalogObj)
|
180 |
catalogObjs.append(catalogObj)
|
| 180 |
|
- |
|
| 181 |
catalogObjs[0]['_childDocuments_'].append({'id':'dummy'})
|
181 |
catalogObjs[0]['_childDocuments_'].append({'id':'dummy', "color_s":"Black","itemId_i":1, "mop_f":460.0, "tagId_i":2, "sellingPrice_f":500.0})
|
| 182 |
solr.delete(q='*:*')
|
182 |
solr.delete(q='*:*')
|
| 183 |
solr.add(catalogObjs)
|
183 |
solr.add(catalogObjs)
|
| 184 |
|
184 |
|
| 185 |
|
185 |
|
| 186 |
|
186 |
|