Binaryy commited on
Commit
44003ea
1 Parent(s): e700a38

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -1
app.py CHANGED
@@ -61,7 +61,30 @@ def search(query):
61
  match_ids = [match['id'].split('-')[0] for match in xc['matches']]
62
  # Query the existing DataFrame based on 'id'
63
  filtered_df = df[df['_id'].isin(match_ids)]
64
- attributes_to_extract = ['_id', 'postedBy.accountName', 'images', 'title', 'location', 'price']
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  extracted_data = filtered_df[attributes_to_extract]
66
  result_json = extracted_data.to_json(orient='records')
67
  return result_json
 
61
  match_ids = [match['id'].split('-')[0] for match in xc['matches']]
62
  # Query the existing DataFrame based on 'id'
63
  filtered_df = df[df['_id'].isin(match_ids)]
64
+ attributes_to_extract = ['_id', 'title', 'location', 'features', 'description', 'images',
65
+ 'videos', 'available', 'price', 'attachedDocument', 'year',
66
+ 'carCondition', 'engineType', 'colour', 'model', 'noOfBed',
67
+ 'noOfBathroom', 'locationISO', 'forRent', 'views', 'thoseWhoSaved',
68
+ 'createdAt', 'updatedAt', '__v', 'category._id', 'category.title',
69
+ 'category.slug', 'category.isAdminAllowed', 'category.createdAt',
70
+ 'category.updatedAt', 'category.__v', 'postedBy.pageViews.value',
71
+ 'postedBy.pageViews.users', 'postedBy.totalSaved.value',
72
+ 'postedBy.totalSaved.users', 'postedBy._id', 'postedBy.firstName',
73
+ 'postedBy.lastName', 'postedBy.about', 'postedBy.cover',
74
+ 'postedBy.email', 'postedBy.password', 'postedBy.isAdmin',
75
+ 'postedBy.savedListing', 'postedBy.isVerified',
76
+ 'postedBy.verifiedProfilePicture', 'postedBy.profilePicture',
77
+ 'postedBy.pronoun', 'postedBy.userType', 'postedBy.accountType',
78
+ 'postedBy.subscribed', 'postedBy.noOfSubscription',
79
+ 'postedBy.totalListing', 'postedBy.sellerType', 'postedBy.createdAt',
80
+ 'postedBy.updatedAt', 'postedBy.__v', 'postedBy.address',
81
+ 'postedBy.city', 'postedBy.country', 'postedBy.gender',
82
+ 'postedBy.nationality', 'postedBy.verificationType', 'postedBy.dob',
83
+ 'postedBy.locationISO', 'postedBy.state', 'postedBy.zipCode',
84
+ 'postedBy.otherNames', 'postedBy.facebookUrl', 'postedBy.instagramUrl',
85
+ 'postedBy.phoneNumber1', 'postedBy.phoneNumber2', 'postedBy.websiteUrl',
86
+ 'postedBy.accountName', 'postedBy.accountNo', 'postedBy.bankName',
87
+ 'string_features', 'complete_description']
88
  extracted_data = filtered_df[attributes_to_extract]
89
  result_json = extracted_data.to_json(orient='records')
90
  return result_json