zenaight commited on
Commit ·
7afea51
1
Parent(s): 2df7373
Refine property search query ordering in database
Browse files- Updated the property search query in `search_properties` to use `desc=True` for ordering featured properties, enhancing clarity and aligning with best practices for query construction.
- database.py +1 -1
database.py
CHANGED
|
@@ -326,7 +326,7 @@ async def search_properties(filters: dict) -> list:
|
|
| 326 |
query = query.contains("features", [feat])
|
| 327 |
|
| 328 |
# e. Order & limit
|
| 329 |
-
query = query.order("is_featured",
|
| 330 |
|
| 331 |
# f. Execute and return
|
| 332 |
resp = query.execute()
|
|
|
|
| 326 |
query = query.contains("features", [feat])
|
| 327 |
|
| 328 |
# e. Order & limit
|
| 329 |
+
query = query.order("is_featured", desc=True).order("price", desc=False).limit(5)
|
| 330 |
|
| 331 |
# f. Execute and return
|
| 332 |
resp = query.execute()
|