Binaryy commited on
Commit
32e08f8
1 Parent(s): 4bc7866

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -55,13 +55,13 @@ def search(query):
55
  xc = index.query(
56
  vector=dense,
57
  sparse_vector=sparse,
58
- top_k=2, # how many results to return
59
  include_metadata=True
60
  )
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 = ['title', 'images', 'price', 'noOfBed', 'postedBy.address', 'postedBy.city']
65
  extracted_data = filtered_df[attributes_to_extract]
66
  result_json = extracted_data.to_json(orient='records')
67
  return result_json
 
55
  xc = index.query(
56
  vector=dense,
57
  sparse_vector=sparse,
58
+ top_k=5, # how many results to return
59
  include_metadata=True
60
  )
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