In the previous chapter we saw a very simple application that performed a full-text search on the feed items. In this chapter we will create a more advanced application. So pull up your socks, and get ready to build a complex search application that will search through real estate property listings.
In this chapter we shall:
So let's get on with it...
This application will search a database of real estate properties. We will create this database and populate it with some data. A property will have the following associated information (fields):
We will be creating different search forms; such as a simple, an advanced, and a geo location based search. These forms will have the following characteristics:
We will be using the following software and tools to build this application:
We will be building this application on the same lines as we did in the previous chapter. We will use the same HTML/CSS to build our views.
Let's get started by creating the database structure. Firstly, we will need a table to hold the property's data; such as type, description, price, number of bedrooms, and so on. We will call this table properties
.
Each property will be located in a city. It will make sense to normalize the city data so that the same city can be used for multiple properties. To do this, we will create a table cities
and relate it to the properties
table.
We will also need to associate amenities (parking, swimming pools, gardens, and so on) to properties. Again we will normalize amenities and keep it in its own table. An amenity can be associated with multiple properties and a property can have multiple amenities. To create such an association we will create a table amenities_properties.