Tutorial - Property Search & Review
After completing the previous chapter (Building a Housing Rental), you should have set up a Tacnode instance and implemented some core features of the homestay platform. This includes publishing, modifying, and deleting listings from the landlord's perspective, as well as searching for and commenting on listings from the tenant's view. In this article, we will explore how to locate a target listing using basic information and reviews from the Airbnb test data set, and we will assess the ordered listings.
Scenarios
Once a user selects a destination, the next step is to choose accommodations. Let's explore a few scenarios demonstrating how the homestay platform allows customers to carry out various tasks, from selecting rooms to booking and reviewing orders.
-
Begin by identifying a property that fits your requirements using criteria such as:
- Keywords related to the listing, including the location and hotel name
- The dates you wish to book
-
Narrow down the property list by applying specific filters, such as:
- Ensuring the listing's rating exceeds a predetermined level
- Setting a price range for the property
- Specifying the number of beds available
-
After compiling a list of suitable properties, choose a few that interest you and review prior guest feedback to aid in your property selection process.
-
Once your stay is complete, you will review the property and share your accommodation experience.
Table Design
Listings
The properties listings table includes details about each property. Every property has a distinct ID and associated attributes like name, room type, and price.
Reviews
This table contains property reviews, with each review linked to a listing_id.
Calendar
This table holds the available dates for a property. Each entry is linked to a listing_id and a date, showing if the property can be booked on that specific date.
Data Import
To start, confirm that all three tables are set up, and then utilize the copy method to transfer data. For example, we will use sample data from Hong Kong (the number of rows in sample data downloaded at different times may differ slightly). After downloading, be sure to extract it to a local directory. For additional instructions on importing data, see the document Data Import and Export.
To enable a full-text search of the name field, we revised the table structure and added a new column with a tsvector
type.
Find Target Properties
Typically, the initial stage of booking accommodation involves selecting a property based on specific keywords or your check-in time. Below are examples illustrating these two situations. It’s important to note that while you can search using both keywords and check-in times simultaneously, this combination will not be discussed here, nor will it be in the following chapters.
Find target properties using hotel keywords
Tacnode enables full-text search functionality via tsvector
. For information on using tsvector
, see Full Text Search.
For example, if a user intends to search for Condo
For example, if you wish to find a Condo
in the vicinity of Sai Wan
Find target properties by check-in date
Initially, utilizing a homestay platform involves filtering houses according to the specified check-in time. Verifying the house’s availability is essential by checking the calendar table.
Filter Target Properties
Once we identify a list of properties that align with your time and availability requirements, we must apply additional filtering criteria to refine our options. For instance, we might want to filter based on specific interest conditions. Here are a few examples:
- Score exceeds a certain threshold
- Filter by the number of bedrooms
- Set a price range
Search all properties rated above 4
Search for properties with twin beds
Search for properties costing between 800 and 1000
View Property Reviews
Once users filter the listings by basic information, they arrive at a selection of target options. Before placing an order, they typically click on a specific listing to read previous guest reviews. They particularly focus on past negative reviews to steer clear of potential issues.
Submit Property Reviews
Post Reviews
Post your review of a property.
Edit Reviews
Revise and update existing property reviews
Delete Reviews
Remove the published property reviews