Subversion Repositories SmartDukaan

Rev

Rev 18053 | Rev 18106 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18053 Rev 18089
Line 2398... Line 2398...
2398
        get_mongo_connection().Catalog.DummyUser.update({'_id':data['user_id']},{"$set":data},upsert=False)
2398
        get_mongo_connection().Catalog.DummyUser.update({'_id':data['user_id']},{"$set":data},upsert=False)
2399
        return {'msg':"Data updated successfuly",'response':1}
2399
        return {'msg':"Data updated successfuly",'response':1}
2400
    except:
2400
    except:
2401
        return {'msg':"Unable to update data",'response':0}
2401
        return {'msg':"Unable to update data",'response':0}
2402
    
2402
    
2403
def getDealsForSearchText(subCategoryId, searchTerm, offset, limit):
2403
def getDealsForSearchText(subCategoryIds, searchTerm, offset, limit):
-
 
2404
    subCategories= [int(subCategoryId) for subCategoryId in subCategoryIds.split('^')]
2404
    payload = {
2405
    payload = {
2405
      "query": {
2406
      "query": {
2406
        "bool": {
2407
        "bool": {
2407
          "must": [
2408
          "must": [
2408
            {
2409
            {
Line 2414... Line 2415...
2414
               }
2415
               }
2415
            },
2416
            },
2416
            {
2417
            {
2417
              "match": {
2418
              "match": {
2418
                "subCategoryId": {
2419
                "subCategoryId": {
2419
                  "query": subCategoryId
2420
                  "query": subCategories
2420
                }
2421
                }
2421
              }
2422
              }
2422
            }
2423
            }
2423
          ]
2424
          ]
2424
        }
2425
        }
Line 2435... Line 2436...
2435
            tempMap = {'skuBundleId':x['_source']['id'],'title':x['_source']['title']}
2436
            tempMap = {'skuBundleId':x['_source']['id'],'title':x['_source']['title']}
2436
            temp.append(tempMap)
2437
            temp.append(tempMap)
2437
            bundles.append(x['_source']['id'])
2438
            bundles.append(x['_source']['id'])
2438
    return getDealsForNotification(bundles, skipSplitting=True)
2439
    return getDealsForNotification(bundles, skipSplitting=True)
2439
 
2440
 
2440
def getCountForSearchText(subCategoryId, searchTerm):
2441
def getCountForSearchText(subCategoryIds, searchTerm):
-
 
2442
    subCategories= [int(subCategoryId) for subCategoryId in subCategoryIds.split('^')]
2441
    payload = {
2443
    payload = {
2442
      "query": {
2444
      "query": {
2443
        "bool": {
2445
        "bool": {
2444
          "must": [
2446
          "must": [
2445
            {
2447
            {
Line 2451... Line 2453...
2451
               }
2453
               }
2452
            },
2454
            },
2453
            {
2455
            {
2454
              "match": {
2456
              "match": {
2455
                "subCategoryId": {
2457
                "subCategoryId": {
2456
                  "query": subCategoryId
2458
                  "query": subCategories
2457
                }
2459
                }
2458
              }
2460
              }
2459
            }
2461
            }
2460
          ]
2462
          ]
2461
        }
2463
        }