Thursday, November 19, 2009

Keeping a local database current..

MLSs ask me all the time how their 3rd party vendors can keep a local database current when they only have access to Active listings. In terms of IDX - how does the 3rd party delete listings which have become Off-Market if they can only query On-Market? Here's my answer...

Let's say Active, IDX listings in your MLS are Status = A.

Have the vendor query ML# - they'll only get listings to which you have given them access, in this example:

WHERE Status = A

We call this a "Reference File". Run that Reference File against the local database. Delete listings in the local database

WHERE My_Database_ML# <> Reference_File_ML#


Finally, run a RETS query for all listings:

WHERE Update_Date > My_Last_Run_Date


The first step will provide a list of all Active ML#s. When that is run against the local database any listing in the local database which is no longer On-Market will be deleted. Doing a SELECT * from the RETS server WHERE Update_Date > My_Last_Run_Date will provide updates for the local database for listings which are still on the market and have been modified since yesterday - or whenever the process was last run.

If anyone has anything better please post.

1 comment:

  1. I agree with this approach. However, be extremely certain that when you get all the listing IDs from the RETS server that the server doesn't limit your results!

    We tried this method with RMLS but our results were being capped at 20,000, making it incredibly difficult to get a full set of IDs to compare against. The solution? Our RETS client was, without our knowledge, setting a Limit of 999999 when sending queries. Although that's more than 20,000, it triggered that limit for some reason. By ensuring that a Limit was not being sent at all we were able to retrieve all the listings in one query. We also found it worked by setting the Limit to -1.

    Hope this saves somebody the hours of hairpulling I had to endure =)

    Mike Karikas
    Grand Poobah of Technology
    www.neutrinoinc.com

    ReplyDelete